Commit Graph

4678 Commits

Author SHA1 Message Date
Rodrigo Girão Serrão
9cb32d2b66 Fix alphabetical order. 2023-01-25 11:41:33 +00:00
Rodrigo Girão Serrão
fcba6ecaad Omit default values for attributes.
We copy the mkdocstrings template for attributes so that we can exclude the (default) value for attributes (and class variables) from the documentation as that is generally useless.
2023-01-25 11:41:05 +00:00
Will McGugan
d058477e22 Merge branch 'main' into fix-1372 2023-01-25 12:06:18 +01:00
Will McGugan
aba2633f44 Update tests/test_widget.py
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2023-01-25 12:00:51 +01:00
Will McGugan
8762e34191 Merge branch 'main' into tree-deeply 2023-01-25 11:56:28 +01:00
Will McGugan
a61e61f17b Merge pull request #1637 from davep/widget-importing
Support easier widget "support classes" importing
2023-01-25 11:53:32 +01:00
Will McGugan
5e0996d3aa Merge pull request #1627 from Textualize/fix-1616
Changing overflow programmatically updates layout
2023-01-25 11:52:36 +01:00
Will McGugan
b9b53b8677 Merge branch 'main' into fix-1616 2023-01-25 11:52:29 +01:00
Rodrigo Girão Serrão
3a8ad21aee Merge branch 'main' into fix-1372 2023-01-25 08:11:08 +00:00
Dave Pearson
82e2739196 Merge pull request #1660 from davep/stop-input-double-paste
Fix double-paste into `Input`
2023-01-24 20:55:45 +00:00
Dave Pearson
d101e3d4e7 Fix double-paste into Input
See #1657.
2023-01-24 20:16:50 +00:00
Rodrigo Girão Serrão
fa6bd44866 Housekeeping. 2023-01-24 18:46:37 +00:00
Rodrigo Girão Serrão
ad24349bb2 Move auxiliary type to TYPE_CHECKING. 2023-01-24 18:38:30 +00:00
Rodrigo Girão Serrão
cd0cc6030b Changelog. 2023-01-24 18:36:55 +00:00
Rodrigo Girão Serrão
c8ff5bd14b Add tests. 2023-01-24 18:30:24 +00:00
Rodrigo Girão Serrão
15c95db960 Add mechanism to wait for current and scheduled animations. 2023-01-24 18:22:50 +00:00
Dave Pearson
4bb7326f7d Merge pull request #1656 from davep/app-mount-all-doc-update
Explain the significance of the before/after types (redux)
2023-01-24 17:32:16 +00:00
Rodrigo Girão Serrão
34a08b7fe5 Check if a rule is being animated when updating it.
This is the fix for #1372 because the styles that were sticking had nothing to do with `:hover` per se.
The issue was in the fact that we were trying to start a second animation (back to the default background color) while the first animation hadn't started yet, so we would skip the creation of the new animation but the old one would still run to completion.

This issue also affects animations that start with a delay. If we set an animation A -> B with a delay of 10s and 1s later we set an animation B -> A, then the animation A -> B will run after 9s but the animation B -> A will not run because it was not created in the first place.
2023-01-24 16:29:54 +00:00
Rodrigo Girão Serrão
1d18ac35c5 Add method to check if something is being animated. 2023-01-24 16:29:27 +00:00
Rodrigo Girão Serrão
a01563b068 Add mechanism to keep track of scheduled animations. 2023-01-24 16:29:13 +00:00
Dave Pearson
92c03b0e11 Explain the significance of the before/after types (redux)
Follows on from https://github.com/Textualize/textual/pull/1641 where I did
the update for mounting via Widget but forgot about App.
2023-01-24 15:15:46 +00:00
Will McGugan
d10f0cbc79 docstrings 2023-01-24 16:04:33 +01:00
Will McGugan
1cba4006b9 docstring 2023-01-24 16:02:48 +01:00
Will McGugan
3673b0ff48 keep reference to remove task 2023-01-24 16:01:37 +01:00
Will McGugan
d9dd1dcbe8 simplify 2023-01-24 15:53:53 +01:00
Will McGugan
f97392ac8b added test 2023-01-24 15:24:55 +01:00
Will McGugan
b0d46287e1 Fix hang when removing current widget 2023-01-24 14:44:16 +01:00
Dave Pearson
2841936e15 Clarify how TreeNode.toggle works at depth 2023-01-24 11:36:13 +00:00
Dave Pearson
a36583612c Change TreeNode.toggle to act only from the source node
See https://github.com/Textualize/textual/pull/1644#issuecomment-1401720808
where Darren raises the excellent point that while the "technically correct"
approach that I had was... well, technically correct I guess (it toggled all
the nodes from the target node down), it didn't have what was likely the
desired effect.

So this commit does away with the previous logic for doing the toggle and
instead simply calls on expand or collapse depending on the state of the
source node.
2023-01-24 11:07:40 +00:00
Dave Pearson
6743ec6a30 Fix the defaults for collapse_all and toggle_all
Somehow I'd managed to typo them as True when they obviously should be False
to maintain backward-compatibility (and generally this is the only sensible
default).
2023-01-24 10:47:44 +00:00
Dave Pearson
8815d82ba4 Remove unnecessary import
This got added while I was experimenting with something earlier, and I
forgot to remove it and didn't notice it slip in with a commit.
2023-01-24 10:36:42 +00:00
Dave Pearson
2662e6b292 Merge pull request #1652 from davep/remove-children-updated-doc-reference
Remove mention of `ChildrenUpdated` from the `ListView` docs
2023-01-24 09:54:32 +00:00
Dave Pearson
faac89fd8d Remove mention of ChildrenUpdated from the ListView docs
As pointed out in #1649, a `ChildrenUpdated` message is documented but it
doesn't exist in the code. It looks like it got added during development,
then removed after it was realised it wasn't needed, but presumably it got
left in the docs:

  https://github.com/Textualize/textual/pull/1143#discussion_r1030409026
2023-01-24 07:47:18 +00:00
Dave Pearson
bf8a2745bc Update the CHANGELOG 2023-01-23 21:25:48 +00:00
Dave Pearson
20636a5534 Remove some duplication of effort
No need to set the keyword to True when I can just pass the parameter's
value in anyway. This reads a bit nicer.
2023-01-23 21:21:56 +00:00
Dave Pearson
91d6f2b973 Force keyword argument use for expand/collapse/toggle_all
It might seem excessive for just a single argument, but I feel it's
worthwhile doing it here. It's a single boolean parameter on each of the
methods that, left bare, will always end up reading badly. Consider:

    tree.toggle( True )

vs:

    tree.toggle( toggle_all=True )

the former looks awkward at best and ugly at worst; toggle True? What does
that even mean? The latter, while a touch more verbose, makes it really
clear what's going on.

Trying this on for size.
2023-01-23 21:12:16 +00:00
Dave Pearson
c57ca884ca Correct some terrible English 2023-01-23 21:09:21 +00:00
Dave Pearson
2ac3a03471 Add a missing type hint to TreeNode._expand 2023-01-23 20:56:09 +00:00
Dave Pearson
a3c7430f4a Merge branch 'main' into tree-deeply 2023-01-23 19:57:14 +00:00
Rodrigo Girão Serrão
034d1f8940 Merge branch 'main' into fix-1607 2023-01-23 18:37:16 +00:00
Rodrigo Girão Serrão
dde90a8069 Merge pull request #1646 from Textualize/test-pause
Add pause to flaky test.
2023-01-23 18:36:08 +00:00
Rodrigo Girão Serrão
5c73387bca Pause before rendering input widget. 2023-01-23 18:13:27 +00:00
Rodrigo Girão Serrão
3f2ecd1ad8 Update changelog. 2023-01-23 18:11:33 +00:00
Rodrigo Girão Serrão
c1bac9cd8f Update changelog. 2023-01-23 18:03:55 +00:00
Rodrigo Girão Serrão
3d0b607798 Merge branch 'main' into fix-1616 2023-01-23 18:03:27 +00:00
Rodrigo Girão Serrão
f93e14028d Lift styles. 2023-01-23 18:02:57 +00:00
Rodrigo Girão Serrão
cb73dd4ba9 Remove xfail marker. 2023-01-23 18:00:44 +00:00
Rodrigo Girão Serrão
bb1e8d2eec Refresh scrollbars when overflow changes. 2023-01-23 18:00:37 +00:00
Dave Pearson
3212fbc3b7 Merge branch 'main' into widget-importing 2023-01-23 17:44:38 +00:00
Dave Pearson
289135a1c9 Update the CHANGELOG
This aims to make it clear that a small but significant breaking change has
taken place. See #1637.
2023-01-23 17:42:08 +00:00