Commit Graph

5969 Commits

Author SHA1 Message Date
Will McGugan
80f4c12e76 Fix scroll flicker (#2358)
* fix scroll flicker

* fix scroll flicker

* remove event

* do not delay scroll

* remove comment

* test fix

* remove commented code

* comment

* increase pause on click

* changelog [skip ci]

* wait on resume

* remove note [skip ci]
2023-04-24 09:33:15 +01:00
Dave Pearson
8b6d9027e9 Merge pull request #2353 from davep/bug/2352/tabbed-content-active 2023-04-23 16:40:39 +01:00
Will McGugan
24a17ba914 Merge branch 'main' into bug/2352/tabbed-content-active 2023-04-23 16:04:06 +01:00
Rodrigo Girão Serrão
50030b427f Fix up/down key ansi sequences. (#2280)
* Fix up/down key ansi sequences.

Related issues: #2223.
Related comments: [my reply to OP](https://github.com/Textualize/textual/issues/2223\#issuecomment-1505512300) and [the OP's reply](https://github.com/Textualize/textual/issues/2223\#issuecomment-1506764562).

* Changelog.
2023-04-23 14:14:36 +01:00
Will McGugan
3736807359 fix color system render (#2360)
* fix color system render

* changelog
2023-04-22 17:49:00 +01:00
Dave Pearson
1a84be9fc9 Update the CHANGELOG 2023-04-22 10:29:00 +01:00
Dave Pearson
75543fbd4c Merge branch 'main' into bug/2352/tabbed-content-active 2023-04-22 10:28:02 +01:00
Will McGugan
a2633ca31e fix text opacity (#2356) 2023-04-22 08:50:14 +01:00
Dave Pearson
a351d620b2 Add some pauses to the UI-baed tabbed content tests
This particular test seems rather flakey in GitHub's actions. In most cases
passing, with the odd fail here and there (normally when unrelated changed
are made -- I've had this fail when docs have been changed; zero code
changes!)

So, on the off chance that a little extra pause will help...
2023-04-22 08:42:38 +01:00
Dave Pearson
c022d9de2f Fix TabbedContent.active not changing actual content
Ensures that the actual content gets changed when TabbedContent.active is
updated via code. Also adds more testing for TabbedContent.

See #2352 for details.
2023-04-22 08:28:12 +01:00
Dave Pearson
9e19706b53 Merge pull request #2345 from davep/button-docs-tweakage
Some more Button docs tidying
2023-04-21 09:07:25 +01:00
Dave Pearson
ccf4f06a74 Some more Button docs tidying
While I'm in this file... might as well link the word "variant" to the type
that it's referring to.
2023-04-21 07:57:48 +01:00
Dave Pearson
cd5d9d1e4f Merge pull request #2344 from davep/type-button-pressed-button-in-docs
Small improvement to the `Button.Pressed` event documentation
2023-04-21 07:47:51 +01:00
Dave Pearson
b34ab0d9a4 Small improvement to the Button.Pressed event documentation
This makes `button` as obvious as `control`, and also ensures it has a type
in the docs too. While here I also add a couple of extra links to make the
docs more inter-linked.
2023-04-21 07:38:42 +01:00
Will McGugan
cab4925eaa New CLI runner (#2338)
* New CLI runner

* runner functionality

* Add port

* use env for port

* changelog

* test fix

* flush

* remove constant

* comment

* tidy docs

* docstrings

* punctuation

* docstring

* fix test

* snapshot

* Update src/textual/cli/cli.py

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* guard against bad imports

* guard againsts screenshot

* always print return

* docstrings

* docstrings

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-04-20 17:09:39 +01:00
Dave Pearson
c8ecd26234 Merge pull request #2340 from davep/assorted-doc-tweaks
Assorted doc tweaks
2023-04-20 16:20:11 +01:00
Dave Pearson
d4f7ef02bb Merge pull request #2337 from davep/bug/2100/invisible-keys
Move default scroll navigation keys out of `Widget` and into `ScrollableContainer`
2023-04-20 15:37:45 +01:00
Dave Pearson
83da429793 Small collection of docstring tweaks 2023-04-20 14:13:56 +01:00
Dave Pearson
4801b3bc8f Link the doc for Checkbox.Changed.control to checkbox 2023-04-20 14:01:33 +01:00
Dave Pearson
8ea6658877 Link the doc for RadioButton.Changed.control to radio_button 2023-04-20 13:59:44 +01:00
Dave Pearson
84b5b866d4 Merge branch 'main' into bug/2100/invisible-keys 2023-04-20 13:45:30 +01:00
Dave Pearson
60542c52b3 Merge pull request #2339 from davep/refresh-all-the-screens
Ensure an app's CSS refresh updates all screens in the stack
2023-04-20 13:44:45 +01:00
Dave Pearson
61dc08dd99 Update the CHANGELOG 2023-04-20 11:42:14 +01:00
Dave Pearson
ae656c21c1 Refresh the CSS for all screens in an app's stack, when asked to refresh
Addresses #1999.
2023-04-20 11:39:12 +01:00
Dave Pearson
c507c4a785 Driveby typo fix
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-04-20 11:14:11 +01:00
Dave Pearson
b6b8fbdb41 Fix typo
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-04-20 11:13:01 +01:00
Dave Pearson
14f05899b2 Correct the location of the new items in the CHANGELOG
I'd accidentally started adding things under v0.20.1 rather than under a new
unreleased heading.
2023-04-20 10:09:20 +01:00
Dave Pearson
59e325d004 Update the CHANGELOG 2023-04-20 10:08:40 +01:00
Dave Pearson
1c5909eb23 Update the binding inheritance tests for the new moment bindings approach
Now that navigation bindings don't pollute the whole widget hierarchy any
more some of these tests can be tidied up.
2023-04-20 10:04:32 +01:00
Dave Pearson
8a909b0d0a Change all containers so they don't inherit bindings
This is, to some degree, rendered moot by #2332, but for the moment it still
feels worth doing. The initial intention was to make sure that non-scrolling
containers and their child classes don't have bindings that may mask other
uses for navigation keys. However, it was realised that the "problem"
affected more than just containers (hence #2332).

But... on the off chance we add any more default bindings to
`Widget` (unlikely, but still), this will mean that they don't leak into the
containers unless we intend them to.

See #2331.
2023-04-20 09:51:50 +01:00
Dave Pearson
7d82e30684 Fix demo so that keyboard navigation scrolls the display again
The `Body` class inherited from `Container` rather than one of the scrolling
containers; until now it had worked because `Widget` provided the bindings
to make this happen, now that they've moved into `ScrollableContainer` that
stopped working.
2023-04-20 09:42:29 +01:00
Dave Pearson
fe5f80bdd6 Change ScrollView to inherit from ScrollableContainer rather than Widget
See #2332
2023-04-20 09:40:58 +01:00
Dave Pearson
f4e5f23053 Merge pull request #2336 from davep/tidy-widget
Remove unused import from widget.py
2023-04-20 09:32:01 +01:00
Dave Pearson
ee45356c5c Update the CHANGELOG 2023-04-20 09:31:28 +01:00
Dave Pearson
49422932c7 Move scroll navigation key bindings out of widget and into own container
The idea here is that not every widget will scroll, and as such not every
widget needs to have default bindings for calling the scrolling methods.
Generally scrolling is something done in a container.

These days we have *Scroll containers. As such it makes sense to introduce
the bindings in a common parent class for those containers.

This commit moves the binding from widget and creates that common parent
class, and then has HorizontalScroll and VerticalScroll inherit from it.

This is, it should be noted, a breaking change. Any code that creates a
scrolling widget that assumes that the bindings are just there, where that
widget doesn't inherit either from HorizontalScroll or VerticalScroll, will
suddenly find that scrolling with the keyboard is no longer possible.

See #2332.
2023-04-20 09:15:05 +01:00
Dave Pearson
88b068fd64 Remove unused import from widget.py 2023-04-20 08:59:38 +01:00
Will McGugan
550cd47123 docstring 2023-04-19 17:13:57 +01:00
Will McGugan
d7f5fb9107 Fix frame rate limiter (#2318)
* simplify

* fix for frame rate limiter

* fix update

* fix update

* update comment

* No need for lock

* remove comment

* fix for glitched test

* force update

* implement dim fix

* docstrings

* foreground fix

* cached filters

* cache default

* fix for filter tests

* docstring

* optimization

* Update src/textual/filter.py

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update src/textual/constants.py

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* fix cache

* remove comment [skip ci]

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-04-19 16:55:42 +01:00
Dave Pearson
0e8e232a08 Merge pull request #2328 from davep/footer-cleanup
Clean up various warnings in _footer.py
2023-04-19 13:41:07 +01:00
Dave Pearson
f6612490df Clean up various warnings in _footer.py
While visiting this for other reasons I noticed a number of warnings about
the code that were easy to tidy up. So I tidied them up.
2023-04-19 13:27:10 +01:00
Will McGugan
81882fdf7d implement dim fix (#2326)
* implement dim fix

* docstrings

* foreground fix

* cached filters

* cache default

* fix for filter tests

* docstring

* optimization

* Update src/textual/filter.py

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update src/textual/constants.py

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-04-19 13:24:31 +01:00
Dave Pearson
7c5203aa1b Merge pull request #2321 from davep/screen-results
Add support for "returning" a result value from screens.
2023-04-19 11:47:09 +01:00
Dave Pearson
768a235f3a Improve a docstring
Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-04-19 11:40:34 +01:00
Dave Pearson
9123a80aa5 Update a screen instance's callback stack when it is switched out
As per the observation here:

  https://github.com/Textualize/textual/pull/2321#pullrequestreview-1391744148
2023-04-19 11:39:19 +01:00
Dave Pearson
5689e62230 Merge pull request #2325 from davep/private-event-handlers
Make textual.widgets.* event handlers private
2023-04-19 11:15:29 +01:00
Dave Pearson
5886c6bd0c Make DataTable event handlers private
See #2324.
2023-04-19 10:13:23 +01:00
Dave Pearson
36aa3321ff Make ToggleButton event handlers private
See #2324.
2023-04-19 10:07:36 +01:00
Dave Pearson
d23024141c Make Tabs event handlers private
See #2324.
2023-04-19 10:05:53 +01:00
Dave Pearson
1063c0f94c Make Switch event handlers private
See #2324.
2023-04-19 10:04:05 +01:00
Dave Pearson
d2c8206a8e Make RadioSet event handlers private
See #2324.
2023-04-19 10:02:47 +01:00