Commit Graph

4871 Commits

Author SHA1 Message Date
Dave Pearson
d0a9656fcc Merge branch 'main' into promote-disabled 2023-02-14 16:23:05 +00:00
Dave Pearson
8ebb70efac Refresh the snapshots 2023-02-14 16:22:15 +00:00
Dave Pearson
26df6aeb00 Tidy up the disabled snapshot test 2023-02-14 16:20:52 +00:00
Dave Pearson
b4f8a6b778 Add disabled snapshot test to the general snapshot tests 2023-02-14 15:53:45 +00:00
Dave Pearson
fbd871c3d7 Start a snapshot test for disabled widgets
Eventually this should likely have every user-interactive widget within it.
Perhaps every widget.
2023-02-14 15:52:52 +00:00
Dave Pearson
13e404dc5a Merge pull request #1790 from davep/tidy-list-view-docstrings
Tidy up various docstrings in ListView
2023-02-14 15:36:09 +00:00
Dave Pearson
3cd879d2a6 Correct the wording of what the up/down actions do
There's a difference here between select and highlight and I got sloppy with
the wording. This corrects that.
2023-02-14 15:25:15 +00:00
Dave Pearson
f92f7786b2 Tidy up various docstrings in ListView
Adding some actions docstrings (#1729) and also tweaking a couple of others
to better conform with our docstring standard.
2023-02-14 15:11:56 +00:00
Dave Pearson
7763020f53 Move future import to after the module docstring
Looks like someone added this but placed it before the module docstring.
Fixing it as I notice it.
2023-02-14 15:00:57 +00:00
Dave Pearson
e26e75a9d1 Swap game_playable to use the simplified disable ability 2023-02-14 14:59:53 +00:00
Dave Pearson
5e0190c43f Add unit tests for disabled property and pseudoclass 2023-02-14 14:47:57 +00:00
Dave Pearson
b7872e2422 Merge pull request #1789 from davep/tidy-even-more-property-docstrings
Assorted docstring tidying in dom.py
2023-02-14 14:19:25 +00:00
Dave Pearson
07bc450a50 Assorted docstring tidying in dom.py
Noticed that there were a few properties that still had types in the
docstrings; which we've since decided to not do; so this removes them. Also
some other assorted docstring tweaks in the same file.
2023-02-14 14:12:25 +00:00
Dave Pearson
7c5020ddd3 Add a disabled keyword argument to the TextLog constructor 2023-02-14 13:27:44 +00:00
Dave Pearson
67b57d8a28 Add a disabled keyword argument to the DirectoryTree constructor 2023-02-14 13:14:52 +00:00
Dave Pearson
69af2bfd57 Add a disabled keyword argument to the Tree constructor 2023-02-14 13:11:44 +00:00
Dave Pearson
20aaf0f205 Add a disabled keyword argument to the ListView constructor 2023-02-14 13:04:44 +00:00
Dave Pearson
e1a60d9225 Add a disabled keyword argument to the Input constructor 2023-02-14 12:53:56 +00:00
Dave Pearson
9e4d4aae5e Add a disabled keyword argument to the Switch constructor 2023-02-14 12:50:58 +00:00
Dave Pearson
3c8f464818 Update the snapshots
The disabled styling has changed slightly, and there is a snapshot test for
buttons which is now thrown off. This updates that.
2023-02-14 11:44:36 +00:00
Dave Pearson
c65278d038 Add default disabled styling for the whole application 2023-02-14 11:31:31 +00:00
Dave Pearson
cccf7afccb Remove :disabled styling from the Button
This will move up to the App's default styles.
2023-02-14 11:30:55 +00:00
Dave Pearson
068aa07a5e Only enable Enter and Leave if not disabled
Until now I was just removing all events that inherited from MouseEvent when
checking if an event was enabled for a given widget, in relation to the
widget itself being disabled. Enter and Leave also need to be taken into
account; they don't inherit from MouseEvent (they're more reactions to mouse
events) but should be handled too.
2023-02-14 11:28:31 +00:00
Dave Pearson
7c81247a95 Remove Button.watch_mouse_over
This isn't needed any more.
2023-02-14 11:22:25 +00:00
Dave Pearson
d27d9f81af Only block mouse events if disabled, not if not focusable 2023-02-14 10:51:32 +00:00
Dave Pearson
674ee26b88 Add a docstring to watch_disabled 2023-02-14 10:40:17 +00:00
Dave Pearson
bff4334c5a Merge branch 'main' into promote-disabled 2023-02-14 10:31:36 +00:00
Dave Pearson
c7990d990d Add support for disabling a widget and all of its children 2023-02-14 09:56:09 +00:00
Will McGugan
ea74ca7725 Merge pull request #1778 from Textualize/screens-redux
implements screens view
2023-02-14 09:55:07 +00:00
Will McGugan
2db2ae1b52 property docstring 2023-02-14 09:34:04 +00:00
Will McGugan
6f1abe849f fix reference 2023-02-13 17:30:53 +00:00
Will McGugan
497503fa3a docstrings 2023-02-13 17:14:52 +00:00
Dave Pearson
ea8470ee7a Stop mouse events going to a widget that can't receive focus right now 2023-02-13 16:55:08 +00:00
Dave Pearson
525455bf76 Bring the focus_chain docstring in line with out newer guidelines 2023-02-13 16:19:38 +00:00
Dave Pearson
d148dd6237 Swap _reset_focus over to focsuable (from can_focus) 2023-02-13 16:14:13 +00:00
Dave Pearson
813c89c1ef Swap _forward_event over to focsuable (from can_focus) 2023-02-13 16:12:28 +00:00
Dave Pearson
850c140a05 Swap set_focus over to checking focusable 2023-02-13 16:10:28 +00:00
Will McGugan
2a8b099f33 fix 2023-02-13 15:47:38 +00:00
Dave Pearson
0171ad7c85 Build the focus chain from focusable widgets
Rather than it being about widgets where `can_focus` is `True`, have it be
about widgets that are currently able to receive focus. Before this change
widgets with a positive `can_focus` but which were disabled would still end
up in the chain.
2023-02-13 15:44:02 +00:00
Dave Pearson
8379945b60 Remove commented out code from Button
Some hangover from the work to migrate `disabled` out of `Button` and into
`Widget`, that I forgot to remove.
2023-02-13 15:43:40 +00:00
Dave Pearson
bf1188c712 Merge branch 'promote-disabled' of github.com:davep/textual into promote-disabled 2023-02-13 15:43:10 +00:00
Dave Pearson
500458e5f3 Add a focusable property
We want to maintain `can_focus` as "this is a thing that can, at some point,
receive focus, assuming it isn't disabled". So `can_focus` is now very much
about the ability to receive focus at all.

The new `focusable` property becomes about "can this widget receive focus
right now?".

[This is a rewording of a previous commit -- I get the wrong thing]
2023-02-13 15:40:18 +00:00
Dave Pearson
14f83a0a4a Remove commented out code from Button
Some hangover from the work to migrate `disabled` out of `Button` and into
`Widget`, that I forgot to remove.
2023-02-13 15:39:19 +00:00
Will McGugan
4cdc139853 name fix 2023-02-13 15:12:02 +00:00
Dave Pearson
682c4de06d Remove unnecessary comment
Don't use comments as version control! Or, really, I don't need this note to
self any more about the code as it's being handled elsewhere.
2023-02-13 15:11:33 +00:00
Will McGugan
c7e5ac14fb rename 2023-02-13 15:10:32 +00:00
Will McGugan
6b5015b266 mass renaming 2023-02-13 15:09:40 +00:00
Will McGugan
e75024ef58 nanoid 2023-02-13 15:06:26 +00:00
Will McGugan
c6ce34d009 removed deprecate view object 2023-02-13 14:49:39 +00:00
Will McGugan
a845016264 no longer required 2023-02-13 14:41:17 +00:00