Commit Graph

2643 Commits

Author SHA1 Message Date
Dave Pearson
06d1865acc Add 5x5 as an example
*evil grin*
2022-10-19 16:47:25 +01:00
Dave Pearson
84e514e9e6 Merge pull request #954 from davep/bug/939/loss-of-focus-take-2
Try and better settle focus after a focused widget is removed (redux)
2022-10-19 15:35:23 +01:00
Dave Pearson
d4859495c6 Merge pull request #952 from davep/css-walk-children-listify
Modify DOMNode.walk_children to return a list
2022-10-19 15:33:45 +01:00
Will McGugan
46a885cea7 Merge pull request #957 from Textualize/screens-dark
Fix variables in Screens, remove dark reactive from Screen
2022-10-19 15:01:43 +01:00
Darren Burns
d0cfd1a000 Fix variables in Screens, remove dark reactive from Screen 2022-10-19 14:16:13 +01:00
Dave Pearson
11ddcdd771 Better settle focus when removing a focused widget
Addresses the issue raised in #939. Here I rework Screen._reset_focus so
that, rather than deal with siblings, it deals with the focus chain. It now
also optionally takes a list of DOMNodes to avoid and will, as that
suggests, avoid them when looking for somewhere to move focus to.

As a preference the new version of this will seek to settle focus on the
nearest (in the chain) *previous* non-excluded DOMNode.

NOTE: Currently the return value of Widget.walk_children is cast to a list
to ensure that it doesn't get consumed (as of the time of commit, it's still
qan iterable). Once https://github.com/Textualize/textual/pull/952 has been
accepted I'll change this (remove the cast).
2022-10-19 12:55:43 +01:00
Dave Pearson
4a531dca6b Rename buttons in removal tester
This makes it easier for me to see which widget is which in the focus chain,
etc, when logging.
2022-10-19 12:55:04 +01:00
Dave Pearson
78bb052ac7 Add sandbox code for testing work on #939 2022-10-19 10:45:23 +01:00
Dave Pearson
728d1a5454 Don't remove a widget from display before actual removal
This change ensures that, for example, the widget remains in the
Screen.focus_chain so that it's easier to handle passing off focus on
removal.

To help address #939.
2022-10-19 10:44:44 +01:00
Dave Pearson
b56fb018f1 Modify DOMNode.walk_children to return a list
Originally it returned an iterable, building that up from a list anyway. In
local discussion it's been decided that it makes more sense to simply return
the list. There's no obvious advantage to doing it a different way.
2022-10-19 10:02:55 +01:00
Dave Pearson
4b3b622b35 Correct a comment typo 2022-10-19 10:02:31 +01:00
Will McGugan
586ffad1e5 Merge pull request #949 from aaronst/css
docs: remove center layout
2022-10-19 09:07:26 +01:00
Aaron Stephens
4111aa5432 docs: remove center layout 2022-10-18 15:51:23 -07:00
Dave Pearson
f4fafb447f Merge pull request #938 from MatrixManAtYrService/patch-1
Minor doc fixes
2022-10-18 21:20:00 +01:00
darrenburns
e97b612e72 Ensure scroll events are forwarded to the screen (#948)
* Ensure scroll events are forwarded to the screen

* Small fix for scroll event forwarding
2022-10-18 16:11:34 +01:00
Will McGugan
0372c13d2b removed prints 2022-10-18 15:25:49 +01:00
Will McGugan
9b22c6db9e removed print statements 2022-10-18 15:25:04 +01:00
Will McGugan
8fd05f97aa docstrings 2022-10-18 15:21:48 +01:00
darrenburns
4a0dc49bca Checkbox polishing + fix auto-width in Horizontal layout (#942)
* checkbox widget

* fixes

* Checkbox additions, fix content width in horizontal layout

* Update docs, add tests for checkbox

* Remove some test code

* Small renaming of test class

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2022-10-18 15:17:44 +01:00
darrenburns
8c075561a2 Add support for action handlers prefixed with _ (#946) 2022-10-18 15:17:03 +01:00
Will McGugan
7ac3ad2439 Merge pull request #941 from Textualize/bindings-order
key bindings refactor
2022-10-18 15:16:54 +01:00
darrenburns
0f31cc4e45 Add directory of file to run to sys path (#947) 2022-10-18 15:16:46 +01:00
Will McGugan
87b6cbdc0a Update src/textual/app.py
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2022-10-18 15:16:45 +01:00
Will McGugan
45b5d4af0a remove allow forward 2022-10-18 15:00:37 +01:00
Will McGugan
f39e3f0420 added universal keys 2022-10-18 14:57:01 +01:00
Will McGugan
32d18a148f swap order 2022-10-18 14:13:48 +01:00
Will McGugan
cee9d17b76 better typing 2022-10-18 14:08:33 +01:00
Will McGugan
5af46995dd optimize check binding 2022-10-18 14:05:46 +01:00
Will McGugan
a148ab4ddb removed prints 2022-10-18 13:25:21 +01:00
Will McGugan
860df99e1a Merge branch 'css' into bindings-order 2022-10-18 13:24:45 +01:00
Will McGugan
417d6e2d33 removed debug 2022-10-18 12:49:54 +01:00
Will McGugan
0b83170eed fix tests 2022-10-18 11:10:37 +01:00
Will McGugan
6dd73c2173 key bindings refactor 2022-10-18 11:03:42 +01:00
Matt Rixman
6a47d82330 Fix typo in devtools.md
forgotten so install -->  forgotten to install
2022-10-17 09:26:38 -06:00
Will McGugan
3c4f0129ec fix screenshot 2022-10-17 16:22:41 +01:00
Will McGugan
2136068ff1 Merge pull request #937 from Textualize/align-fix
fix alignment bug
2022-10-17 16:22:19 +01:00
Will McGugan
763f245c49 fix alignment bug 2022-10-17 16:14:21 +01:00
Will McGugan
e875db2ee6 Merge pull request #936 from Textualize/focus-glitch
fix focus glitch
2022-10-17 15:53:29 +01:00
darrenburns
45e5658aea Mention ordering of superpower methods in docs (#935) 2022-10-17 15:48:16 +01:00
Will McGugan
b88da06174 fix focus glitch 2022-10-17 15:13:08 +01:00
Will McGugan
73e698dc36 Merge pull request #934 from Textualize/app-title-constructor
Some bug fixes in `Input` + add `title` to `App` constructor
2022-10-17 13:39:03 +01:00
Darren Burns
fc3d1be583 Update snapshots - terminal titles have updated 2022-10-17 12:26:16 +01:00
Darren Burns
4f812f9643 No need to set view_position in constructor 2022-10-17 12:24:11 +01:00
Darren Burns
530b131de0 Allow setting of app title in constructor, fix input validation 2022-10-17 12:06:06 +01:00
Will McGugan
7c304ad7b5 Merge pull request #932 from Textualize/doc-serve-error
fix error with text-log in docs
2022-10-17 11:46:20 +01:00
Will McGugan
4f4c0b13e0 Borders video 2022-10-17 11:45:38 +01:00
Will McGugan
d09bfeeec9 Update easing video 2022-10-17 11:44:00 +01:00
Will McGugan
4bb52daa54 Updated video 2022-10-17 11:37:47 +01:00
Will McGugan
e6876e98ee fix error with text-log in docs 2022-10-17 11:25:26 +01:00
Will McGugan
ab56492dfd Merge pull request #931 from Textualize/input-fix
fix cursor delete issue
2022-10-17 11:16:58 +01:00