Commit Graph

6004 Commits

Author SHA1 Message Date
Will McGugan
55e198767f Add progress bar to gallery (#2399)
* Add progress bar to gallery

* table fix
2023-04-27 11:37:53 +01:00
Dave Pearson
01df8b0726 Make textual.containers 1fr in meaningful dimensions by default (#2386)
* Make all containers 1fr

An unintended consequence of changes made to containers in v0.21.0 (#2377)
is something like #2385 so this commit sort of rolls that change back, and
solidifies how containers are styled by default in respect to their width
and height. Where appropriate the dimensions will be 1fr.

* Make the DEFAULT_CSS of ProgressBar less greedy

It was attempting to style a Vertical that is uses, but in doing so was
styling all Verticals rather than a Vertical within a ProgressBar.

This fixes that.

* Update the CHANGELOG for the container changes

* Move the ProgressBar CHANGELOG entry into the next release section

* Link the container change entry in the CHANGELOG to its PR

Now that the PR is PRd and we have a PR
2023-04-26 17:07:30 +01:00
Rodrigo Girão Serrão
4148b1d450 Implement a Progress Bar widget. (#2333)
* First prototype of PB.

* Repurpose UnderlineBar.

* Factor out 'Bar' widget.

* Revert "Factor out 'Bar' widget."

This reverts commit 0bb4871adf.

* Add Bar widget.

* Cap progress at 100%.

* Add skeleton for the ETA label.

[skip ci]

* Add ETA display.

* Improve docstrings.

* Directly compute percentage.

* Watch percentage changes directly.

[skip ci]

* Documentation.

* Make reactive percentage private.

Instead, we create a public read-only percentage property.

* Update griffe to fix documentation issue.

Related issues: #1572, https://github.com/mkdocstrings/griffe/issues/128.
Related PRs: https://github.com/mkdocstrings/griffe/pull/135.

* Add example and docs.

* Address review feedback.

[skip ci]

* More documentation.

* Add tests.

* Changelog.

* More tests.

* Fix/fake tests.

* Final tweaks.
2023-04-26 15:25:39 +01:00
Will McGugan
ee0d407067 fix changelog 2023-04-26 14:01:15 +01:00
Will McGugan
f20df9b075 Bump0210 (#2381)
* new version

* docstring
v0.21.0
2023-04-26 13:55:41 +01:00
Will McGugan
f53c3cd589 container refactor (#2377)
* container refactor

* Rearrange css

* changelog

* try timer updates

* force update

* sleep idle

* Restore updates
2023-04-26 13:36:08 +01:00
Will McGugan
ff703ad983 pass through unprocessed args (#2374)
* pass through unprocesses args

* omit symbols

* extract args

* posix exception

* timer updates

* another update

* just work on windows damn it

* remove updates
2023-04-26 11:09:04 +01:00
Will McGugan
ec09fb5afc force updates 2023-04-26 10:23:23 +01:00
Dave Pearson
441b98d7a7 Merge pull request #2372 from davep/radioset-redux 2023-04-25 17:21:07 +01:00
Dave Pearson
7a536c790c Demo snapshot test back up to a 250 wait
Waiting 100 resulted in a fail, so let's bump back up again.
2023-04-25 15:49:43 +01:00
Dave Pearson
db45287646 Lower the wait for the demo snapshot test
250 worked; so let's try it lower.
2023-04-25 15:41:02 +01:00
Dave Pearson
88926a4bb8 Force a wee wait when testing the demo
This keeps randomly failing in Windows in CI; multiple subsequent runs gets
it going in the end, normally one further fail at a time. So let's throw a
wee wait on the end and see if that helps.
2023-04-25 15:27:43 +01:00
Dave Pearson
f2c56e7cd5 Link the RadioSet CHANGELOG entry to the new PR 2023-04-25 15:17:02 +01:00
Dave Pearson
0d5db58692 Update the CHANGELOG 2023-04-25 15:09:35 +01:00
Dave Pearson
c45f9358ee Change RadioSet so it's less a container of widgets and more a widget
Initially we went with a RadioSet being a simple container of RadioButtons,
with the user navigating the RadioButtons like you would any other set of
widgets. This was fine but it became pretty clear pretty quickly that having
to tab through a non-trivial collection of buttons in a set to get to the
next widget wasn't ideal.

This commit, satisfying #2368, takes over the navigation of the buttons
within the container, makes the container itself a focusable widget, and
sets up some new bindings to allow a more natural and efficient interaction
with the set.
2023-04-25 15:00:44 +01:00
Dave Pearson
a6a373161f Add some unit testing of the new navigation 2023-04-25 12:06:46 +01:00
Dave Pearson
e16493bf81 Update the snapshot tests
This is necessary now that a focused RadioSet has acquired a border colour
similar to that if a focused Input.
2023-04-25 11:27:23 +01:00
Dave Pearson
59506f3292 Turn a RadioSet into a single focus switching site
With this commit a RadioSet becomes something you can tab into and out of
with just one keypress; navigation of the buttons within moves to being done
with the cursor keys instead.

See #2368.
2023-04-25 11:16:20 +01:00
Dave Pearson
b36afd80a7 Highlight a RadioSet when focus is within it 2023-04-25 10:13:30 +01:00
Dave Pearson
f1d70900cb Merge pull request #2367 from davep/tidy-builtin-actions
Tidy builtin actions
2023-04-24 16:13:35 +01:00
Dave Pearson
4047c83680 Update the CHANGELOG 2023-04-24 15:22:26 +01:00
Dave Pearson
b14b3b9e39 Expand the builtin action list in the docs 2023-04-24 15:12:51 +01:00
Dave Pearson
fee216132f Rename action_remove_class_ to action_remove_class 2023-04-24 15:02:22 +01:00
Dave Pearson
4d3cd1295f Rename action_add_class_ to action_add_class 2023-04-24 15:01:59 +01:00
Dave Pearson
d1ff1b33d6 Expand the docstring for action_back 2023-04-24 15:01:05 +01:00
Dave Pearson
7f4699605e Add a missing docstring argument for action_check_bindings 2023-04-24 14:59:12 +01:00
Dave Pearson
9371b47b9b Merge pull request #2365 from davep/no-container-scroll
Have `Container` *not* show scrollbars by default
2023-04-24 14:15:33 +01:00
Dave Pearson
2055a8996f Move the tutorial over to using ScrollableContainer 2023-04-24 13:13:11 +01:00
Dave Pearson
ca94c5eed0 Merge branch 'main' into no-container-scroll 2023-04-24 11:35:47 +01:00
Rodrigo Girão Serrão
e5033d7d23 Remove hanging lines from docstrings. (#2349)
* Remove hanging lines from docstrings.

Deleted hanging blank lines at the end of docstrings.

Regex pattern:
 - find `\n\n( *)"""`
 - replace with `\n$1"""`
2023-04-24 11:21:38 +01:00
Dave Pearson
a005b81a39 Update the CHANGELOG 2023-04-24 11:18:41 +01:00
Dave Pearson
b896e9d7f9 Update tests to handle scroll changes to Container
See #2361.
2023-04-24 11:10:37 +01:00
Dave Pearson
a91b2c6b35 By default hide the horizontal scrollbar on VerticalScroll
In connection with #2361.
2023-04-24 11:09:52 +01:00
Dave Pearson
d06a4e579d By default hide the vertical scrollbar on HorizontalScroll
In connection with #2361.
2023-04-24 11:09:09 +01:00
Dave Pearson
38e636921c Remove default scrollbars from Container
As per #2361 this removes default scrollbars on Container (and so adds them
on ScrollableContainer).
2023-04-24 11:06:31 +01:00
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