Commit graph

83 commits

Author SHA1 Message Date
Will McGugan
c5f1cbd22c
Loading indicator simplify (#2050)
* nice simplify

* import

* changelog

* doc [skip ci]
2023-03-14 18:04:58 +00:00
Will McGugan
b0f5c35782
tabs widget (#2020)
* tabs widget

* click underline

* color tweak

* docs

* docs update

* expose Tab

* added remove_tab and clear

* fix cycling

* add animation

* docs

* changelog

* remove recompose

* docstrings

* Update docs/guide/actions.md

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

* Rodrigoed the tabs

* Update docs/widgets/tabs.md

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

* Update docs/widgets/tabs.md

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

* copy

* docstrings

* docstring

* docstring

* Apply suggestions from code review

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

* stop click

* docstring

* auto assign consistent IDs

* Apply suggestions from code review

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

* Document bindings

* document bindings

* Apply suggestions from code review

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

* Apply suggestions from code review

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-03-13 14:39:15 +00:00
Will McGugan
198190117d
Loading indicator (#2018)
* loading indicator and tests

* docs

* snapshot

* remove snapshot

* remove debug main [skip ci]

* changelog [skip ci]

* make start time private
2023-03-11 08:36:13 +00:00
Dave Pearson
e6f620db44
Remove underscore pauses from (hopefully) all snapshots
This seeks to remove the "_" from the key presses of snapshots and inline
runs in the documentation. The "_" no longer does anything, but got legacy
reasons at the moment we can't actually allow "_" to be an input to a
"faked" keypress in the docs and snapshots.

Removing these clears the way to letting "_" have the same status as any
other character.

See #1994.
2023-03-09 20:32:27 +00:00
Dave Pearson
aad6d98aa5
More documentation tweaks (#2001)
* Change the title of some widget references to their class names

The widget reference index had a slight mixture of widget title styles, some
being their class name, others being "written English" type titles. This
settles on the titles always being the class name.

* Add a link to the ContentSwitcher to the widget gallery

No screenshot for this, on purpose. By definition this widget isn't visible,
except via other widgets that it's enclosing and handling.

* Have mkdocs watch the main nav file

* Mark the content switcher off the roadmap
2023-03-09 14:01:48 +00:00
Dave Pearson
97a5478bd0
Add ContentSwitcher (#1983)
* Add the basic ContentSwitcher widget

* Docstring tidy

* Add a visible_content property to the ContentSwitcher

* Clarify that children of ContentSwitcher with no IDs get ignored

* Simplify setting the display value

* Add the start of an example ContentSwitcher for the docs

* Tweak the example layout to better fit in small spaces

* Add the content switcher to the API docs

* Add a guide entry for the ContentSwitcher

This one is a wee bit more involved than most other widget entries in the
guide in that it doesn't obviously do anything itself, but needs
developer-input to make it do something useful. As such the outline here
isn't as clean as it could be, but I think it conveys everything necessary
without getting too complicated.

* Add the reactive attribute table to the ContentSwitcher guide

* Update the README

* Add a refresh after everything has been flipped in the switcher

As noted in the code, this should not be necessary and I don't believe it
has anything to do with this code. I would suspect some lower-level issue
with flipping between different widgets within a container. I need to find a
way to make an isolated reproduction that isn't about this particular
widget. Meanwhile though this works with the refresh().

* Swap current from var to reactive

This solves the explicit refresh issue, but only because the refresh is
implied due to the use of a reactive over a var. As such this sort of
addresses #1979 by ignoring the issue rather than diving into it.

I still suspect that I shouldn't need to do this, and that perhaps there's a
refresh issue when you flip display. So I'll keep #1979 kicking around and
at some point see if I can recreate in isolation.

* Add unit tests for the content switcher

* Add snapshot tests for the ContentSwitcher

* Clarify that an exception can be thrown on a bad ID

* Try and help other Pythons

* Add a pause at the end of the second switcher snapshot test

I'm getting a lot of fails in CI; none of them are actual problems.
Hopefully this will cure it.

* Paaaaaaaaause

More of a test than anything else really. My particular snapshot test is
failing but kinda randomly in each environment each time -- sometimes
Windows, sometimes GNU/Linux, different Python versions.

So... yeah, let's try this and see if it makes it through; otherwise I may
need to rethink this.

* New pause

So it turns out that _ doesn't do anything any more; and instead there's a
"wait:<n>" syntax! So let's give that a try.

* Learning my alphabet...

* Fix a typo in the docs.

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

* Add missing full stop.

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

* Add a missing word

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

* Try a longer wait on the switcher

I'm starting to suspect that this doesn't come down to a timing issue;
especially given that the snapshot report seems to be showing some oddity in
the length of the vertical scrollbar. But... I want to be as sure as
possible so let's double the length of the wait.

Bit a bit of me is starting to wonder if I've somehow managed to create the
perfect storm for scrollbars and you don't always get the same result every
time.

Seems unlikely, but if it's not timing it's that or lots of cosmic rays.

* Test a longer pause on the content switcher test

The idea here being that it takes 200ms for the button to pop again.

* Refresh the snapshots

This time. THIS TIME!

* Experiment: is the issue the same name for two tests?

* Experiment: drop the different source files, try terminal size

Having got over the issue of the button not ending up in the same state,
we're stuck with the scrollbar having different sizes. Having tried other
options let's go with tweaking the terminal size.

* Do a little less work when changing current

Rather than set everything invisible then the new one visible, every time
current is changed, instead just make sure everything is invisible up front
and then just swap the affected children each time.

This does mean that if someone messes with the children under the hood they
may see oddness happening, but less work while being less defensive seems
fair here.

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-03-09 11:39:30 +00:00
Mike Driscoll
8cb28b6668
Update button.md example sentence (#1988)
The example was missing a word
2023-03-09 06:46:53 +00:00
Rodrigo Girão Serrão
8b70a464d7 Add subsection to separate example. 2023-03-06 13:54:01 +00:00
Dave Pearson
623b70d4ac
Add an example of using a RadioSet.Changed message (#1935)
Unlike a few other widgets, the RadioSet is pretty much all about reacting
to the selection result; the question of how you go about it has already
come up and while the message is documented, complete with all properties,
it can't hurt to have an illustrative example of code that uses it.

Here I add an extra RadioSet example that sits with the message in the
reference. This should help the reader better follow how to use it, and also
gives something to link to if someone hasn't got that far into the
documentation yet but is attempting to use the RadioSet.
2023-03-06 10:53:12 +00:00
Dave Pearson
b5c028c36d
Fix a docstring typo
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-02-27 13:35:33 +00:00
Dave Pearson
e6e46d0825
Merge branch 'main' into toggle-boxen 2023-02-27 08:53:30 +00:00
Dave Pearson
307b1789a1
Give radio button its own example code now
Still within a RadioSet, but this time only the code that uses RadioSet; not
the code that just uses strings.
2023-02-23 16:00:14 +00:00
Dave Pearson
316faf9e45
Add width reference documentation for radio set 2023-02-23 15:31:32 +00:00
Dave Pearson
a821b2f8f6
Add width reference documentation for radio buttons
A large part of the code to go with this is to show off a radio set; I feel
it makes sense to use the same code for both bits of documentation given
that a radio button only really makes sense inside a radio set.
2023-02-23 15:14:25 +00:00
Will McGugan
dc4421e76a
Merge pull request #1867 from davep/fix-switch-wording
Correct the wording of the description of `Switch.value`
2023-02-23 14:41:08 +00:00
Dave Pearson
4f75a395d8
Fix copy/paste-o in the checkbox reference 2023-02-23 14:35:24 +00:00
Dave Pearson
6738c5686c
Correct the wording of the description of Switch.value
It's not just the default value, it's the ongoing value too and can be used
to change the switch.
2023-02-23 14:28:25 +00:00
Dave Pearson
3fd3d272ce
Add the widget reference for Checkbox 2023-02-23 14:26:11 +00:00
Dave Pearson
a18685c9c8
Fix a copy/paste-o in the TextLog reference entry 2023-02-22 16:28:23 +00:00
Will McGugan
0dac83668b
Merge pull request #1791 from Textualize/textual-markdown
Textual markdown
2023-02-15 09:23:19 +00:00
Will McGugan
08c3a7214e No, I repeat, no abbreviations 2023-02-14 17:28:24 +00:00
Will McGugan
df1edb087c
Merge pull request #1788 from Textualize/datatable-select-headers
DataTable - Message emitted when header selected
2023-02-14 16:42:01 +00:00
Darren Burns
36a9214d7f
Update reactive names in DataTable reference docs 2023-02-14 15:29:05 +00:00
Will McGugan
71d0017ef9 docs and refactor 2023-02-14 15:22:15 +00:00
Darren Burns
49b78daa04
Update docs to include DataTable.HeaderSelected 2023-02-14 15:18:32 +00:00
Will McGugan
6f1abe849f fix reference 2023-02-13 17:30:53 +00:00
Dave Pearson
decc1e2f3c
Rename Checkbox to Switch
A new form of Checkbox will be arriving in Textual soon, working in
conjunction with a RadioButton. What was called Checkbox is perhaps a wee
bit heavyweight in terms of visual design, but is a style of widget that
should remain.

With this in mind we're renaming the current Checkbox to Switch. In all
other respects its workings remains the same, only the name has changed.

Things for people to watch out for:

- Imports will need to be updated.
- Queries will need to be updated; special attention will need to be paid to
  any queries that are string-based.
- CSS will need to be changed if any Checkbox styling is happening, or if
  any Checkbox component styles are being used.

See #1725 as the initial motivation and #1746 as the issue for this
particular change.
2023-02-09 11:10:30 +00:00
David Brochart
d1790caff7 Fix typo 2023-02-01 12:25:00 +01:00
Rodrigo Girão Serrão
bc729033c8 Merge branch 'main' into doc-improvements 2023-01-26 13:55:34 +00:00
Rodrigo Girão Serrão
b37517c400 Add all messages to widget references. 2023-01-26 11:53:51 +00:00
Will McGugan
211280e0be Fixed wording of tree node docs 2023-01-26 12:37:57 +01:00
Will McGugan
dc5041f1e1 update to intro page, fix for API docs 2023-01-26 12:21:49 +01:00
Rodrigo Girão Serrão
210e39488f Add template for widget reference. 2023-01-26 10:56:32 +00:00
Rodrigo Girão Serrão
ef779d71dd Add bindings and component classes to reference pages. 2023-01-25 15:19:16 +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
Darren Burns
be45db4573
Use autodoc for DataTable Messages reference 2023-01-17 13:00:01 +00:00
Darren Burns
23eb13d12d
Some DataTable doc updates, rename Coord -> Coordinate and extract to module 2023-01-17 11:06:21 +00:00
Darren Burns
f327f1d2af
Small datatable docs rewording 2023-01-17 10:11:19 +00:00
Darren Burns
9bc93cd683
Small datatable docs rewording 2023-01-17 10:06:39 +00:00
Darren Burns
65223be8be
Merge branch 'main' of github.com:Textualize/textual into datatable-events 2023-01-16 11:00:10 +00:00
Darren Burns
2814e1f93c
Documentation updates 2023-01-16 10:50:41 +00:00
Rodrigo Girão Serrão
196d430582 Style all Textual CSS as 'sass'
Textual CSS is better highlighted in SASS code blocks because the SASS parser seems to be more lenient.
2023-01-09 11:20:04 +00:00
Rodrigo Girão Serrão
92391339ae
Fix link typo 2022-12-16 11:49:07 +00:00
Dave Pearson
c90e4adaf8
Correct the check list for the ListItem
The checks in the list, which were unckecked, needed spaces in them to
render correctly in the docs.
2022-12-15 16:23:49 +00:00
Will McGugan
9aac3a0cca updated list view 2022-12-10 18:18:28 +00:00
Will McGugan
13a207bacc new blog post 2022-12-10 10:34:34 +00:00
Will McGugan
cebeafbb8b
Merge branch 'main' into list-view 2022-12-09 10:09:07 +00:00
Will McGugan
69ed4b2e0b textlog documentation 2022-12-09 09:01:34 +00:00
Rodrigo Girão Serrão
ba5ec6b34b Merge branch 'main' of https://github.com/Textualize/Textual into placeholder 2022-12-05 15:08:01 +00:00
darrenburns
422f9bed38
Update docs/widgets/list_view.md
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2022-11-30 11:42:42 +00:00