Commit graph

471 commits

Author SHA1 Message Date
darrenburns
5246282c22
Improving data table documentation (#2279)
* Improving data table documentation

* More info on DataTable

* Add note on retrieving cursor coordinate

* Add note on DataTable supporting more than just strings

* Add note on cell styling and justifying - common question

* Slight rewording

* Explaining what "row labels" are.

* Update docs/widgets/data_table.md

Co-authored-by: Will McGugan <willmcgugan@gmail.com>

* Update docs/widgets/data_table.md

Co-authored-by: Will McGugan <willmcgugan@gmail.com>

* Update docs/widgets/data_table.md

Co-authored-by: Will McGugan <willmcgugan@gmail.com>

* Update docs/widgets/data_table.md

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

* Update docs/widgets/data_table.md

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

* Update docs/widgets/data_table.md

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

* Update docs/widgets/data_table.md

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

* Update docs/widgets/data_table.md

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

* Improve data table fixed rows/columns docs

* Update some examples

---------

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-04-13 14:09:19 +01:00
Will McGugan
af93a82fb1 fix byte example 2023-04-10 17:25:13 +01:00
Will McGugan
94279ae1f9 docs fix 2023-04-07 11:35:59 +01:00
Will McGugan
e4b45ba63f
docs on await mount (#2235) 2023-04-07 09:46:27 +01:00
Will McGugan
44367a7422
Expanding fr (#2221)
* forced fr to expand

* margin size

* remove comment

* missing snapshot

* snapshot tests

* changelog

* optimize

* snapshot fix

* snapshot update

* snapshot and fixes

* docstrings [skip ci]
2023-04-06 17:30:32 +01:00
Dave Pearson
23263c45f1
Document the filtering support of DirectoryTree 2023-04-05 20:47:35 +01:00
Will McGugan
b5689b1f69
Worker API (#2182)
* worker class

* worker API tests

* tidy

* Decorator and more tests

* type fix

* error order

* more tests

* remove active message

* move worker manager to app

* cancel nodes

* typing fix

* revert change

* typing fixes and cleanup

* revert typing

* test fix

* cancel group

* Added test for worker

* comment

* workers docs

* Added exit_on_error

* changelog

* svg

* refactor test

* remove debug tweaks

* docstrings

* worker test

* fix typing in run

* fix 3.7 tests

* blog post

* fix deadlock test

* words

* words

* words

* workers docs

* blog post

* Apply suggestions from code review

Co-authored-by: Dave Pearson <davep@davep.org>

* docstring

* fix and docstring

* Apply suggestions from code review

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

* Update src/textual/widgets/_markdown.py

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>

* Update src/textual/worker.py

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

* Fix black

* docstring

* merge

* changelog

---------

Co-authored-by: Dave Pearson <davep@davep.org>
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-04-04 13:12:51 +01:00
Dave Pearson
0be094cf4a
Add OptionList widget (#2154)
* Menu skeleton

The vaguest of starts. Near the end of the day and I want to pick this up
later/tomorrow, so making sure it's on the forge before I go AFK.

* Initial design for populating the menu

One of the driving forces in the design here is that a menu option can have
a prompt that is more than one line in height; and different options can
have different height prompts. This has meant that I've had to finally get
to grips with Rich renderable types and related things.

The menu is going to lean heavily on the line API, and aims to be as
efficient as possible when it comes to having a very large menu. Large menus
are a bad idea! Nobody should be using large menus. On the other hand,
people will do it so let's allow for it.

Work in progress commit. Lots more to come.

* Add a reminder about width

* Make mypy and friend happy with OptionLineSpan.__contains__

* Fix typo

* Add a debug message

I'll remove this later, but I'd like to bubble up some debug stuff into my
own test app.

* Get scrolling working

After battling for ages to try and figure out why scrolling just wasn't
working at all, two things turned out to be at play:

1. If `overflow: hidden` you need force=True. Doh!
   - I should know that too as I added force. O_o
2. Even if you do the above, it doesn't work as you'd expect *if* animation
   is turned on. Turning that off made things work.

I've raised #2077 as a reminder to myself that I need to look into '2' some
more. The menus feel very snappy with animation off, but I suspect there
will be a call to allow animation during menu navigation so that'll need
sorting at some point I guess.

* Add support for home and end keys

Which, shockingly, go to the first and last items in the menu.

* Remind myself I need to remove the Debug message

Once I'm done with it.

* Make the MenuOption class a NamedTuple

There's no obvious benefit to it being a full class, but some benefits to it
being a NamedTuple.

* Add a Menu.OptionHighlighted message

* Add a missing argument to a docstring

* Fully type the option line segments list

I forgot to ensure that it was fully typed.

* Add a method for getting an option at a given position

* Better name for the location of the option

* Include the highlighted index in the OptionHighlighted message

* Add home and end to the binding docstring

* Add support for page up/down in a menu

* Rename OptionLineSegments to OptionLine

It's the details for a line of an option that hold the segments, amongst
other things. No point in repeating information here.

* Add support for a Menu.OptionSelected message

* Remove a TODO comment

It's not that it doesn't need doing yet; it's just that I've moved some TODO
stuff to a WIP document.

* Document the enter binding

* Add a reminder to myself about why animate is off

For a menu I feel that animate *should* be off, but if anyone is reading
this bit of code and feels it should be on, this will explain why it isn't.

* Explain OptionLineSpan a wee bit more

* Import Literal from typing_extensions rather than typing

This is needed for older Pythons.

* Move the prompt shapes calculation code into its own method

* Add a property for getting the option count of the menu

* Add a method of adding an option to the menu

* Highlight first option if no highlight and then movement

* Ensure the virtual height is recalculated on addition

* Remove the method for getting a specific option

There's little point in letting the user treat the menu as if it's an array;
they should know what they put into it and anything that happens *on* the
menu will result in a message which will point to the option anyway.

* Add a menu separator

This isn't the complete version of this; aside from the obvious fact that at
the moment it's just treated line an ordinary menu option (which we don't
want), the presence of a separator means the index of options will be thrown
off, from the user's point of view. The point being, a menu with 4 options
and a separator might look like this:

    Option 1
    Option 2
    --------
    Option 3
    Option 4

I think the index of "Option 3" above should likely be 2 (starting from 0,
of course), not 3. This means I need to tweak the internals of the menu code
to take this into account while also keeping things efficient.

That's next up; but I wanted to get the core of this change in first so I
can noodle away and get the best approach to this.

* Finish off support for menu separators

Here I sort of add support for a menu having both content *and* prompts.
Content is anything that goes in the menu and results in lines being
rendered. Prompts are things that the end user actually gets to select from.
A menu option will have a prompt that has one or more lines. A menu
separator isn't an option but takes up one line.

* Add (back) a method for getting a particular option

Now that the menu content and the menu options are different lists, it's
possible to allow this again. While it still follows that menus shouldn't
really be treated like lists, there's no harm in providing this facility.

* Allow styling separators

* Fix how we tell the Rule to have no style

* Add a documentation line for the separator component class

* Apply default styling to the non-special options

* Set the default color to $text

This isn't actually working, but if I set it to an actual colour, it does
work. Need to dig into this more.

* Remove a TODO warning that isn't valid any more

* Have the menu option messages get the option via Menu.option

It did, and still could, pull directly from the _option property but one
step of indirection means that I can be sure anything "external" is going
via the public interface (yes, I know the message isn't really "external"
but it feels correct to treat it as such because it's for public
consumption).

* Make OptionLine just a Line and drop magic numbers for separators

Rather than overload the option index of the option line class with a magic
number to say that something isn't really an option, here I make the class
just about being a line, I keep the option_index but make it optional (no
pun intended); so that if it's `None` that means "this isn't related to a
menu option".

* Drop the assert that non-option content is a separator

I can't see much benefit in doing this in what should be a fairly tight
loop. This code relates to data that's all under the hood so we shouldn't
need to be quite so defensive.

* Remove unused import of Final

* Add a clear method

* Add support for disabled menu options

At the moment this is done in a way that, as the user navigates, the
disabled options *aren't* skipped. I'm still undecided about this. Your
traditional dropdown menus sometimes do that, sometimes don't do that. And
to make things even more interesting this menu can really be used as a
large-data-friendly listbox and I'm not sure we'd want that there.

This may change.

Also, at this point, I'm also working to keep the MenuOption class a
NamedTuple, which means it's read-only (I don't want the user messing with
things outside of the menu), which means there's interface methods for
changing the disabled state that copy the option and change the disabled
state.

Again, I'll see if I carry on liking this or not. So far I'm okay with this.

* Dial in the styles some more

* Rename some methods that use index to say index in the name

I'm going to be adding support for an id for options too, and want the user
to be able to either access an option via index or via ID. This is the first
step to allowing that.

* Remove an unnecessary inherit

Looks like this was a hangover from an early version of the message classes
and I didn't clean up.

* Fix copy/paste-o

Now there is forever evidence as to where I stole my homework from.

* Add support for menu option IDs

The idea here is that they're purely from, and purely for, the developer who
is creating the menu. Internally I don't care about them and don't
personally use them. However, there is without a doubt a good case for
allowing the developer to specify IDs for options so here's optional support
for that.

* Add a method to get a menu option via an ID

* Reduce property access and list access calls

* Have the content-tracker code do a little less work

* Drop the menu option data attribute

It wasn't going to work well, was going to cause a bunch of problems with
typing, and really it's easier to do by the dev by having them inherit from
MenuOption. So let's do that.

* Remove unused imports

* Add a TODO reminder about subclasses menu optons

* Add an initial bit of unit testing

Just the most basic test so far; it's the end of the day but I want to start
here.

* Allow the caller to use None as an alias for MenuSeparator

In doing so, overhaul how I type candidate menu content vs actual menu
content, setting up a couple of type aliases and making it easier to
maintain.

* Rename the parameter for Menu.add to better match other changes

* Swap MenuOption over to being a standard class

It would have been nice to keep it as a named tuple, but I want the
developer to be able to subclass and add their own properties to the
option (think attaching some random data to a menu option). The problem is
you can't subclass a named tuple.

So... standard class it is, with some reasonably defensive work to
discourage the developer from changing the prompt and the ID on the fly.

For obvious reasons I need to let them change the disabled state on the fly,
and this is where things end up being a little iffy. The only way (right
now) the menu will refresh when the disabled state changes is if the
developer does so via one of the methods on Menu. If they go toggling the
state on the option itself and hope that the menu will reflect this... no,
that's not going to happen.

I *could* make it happen by somehow capturing a reference to the parent menu
inside the menu option, but then things get circular and I don't like that.

* Test using None as an alternative to MenuSeparator

* Flesh out the initial menu unit tests

* Add a module docstring to the core menu unit test

* Add some testing for using subclassed menu options

* Add a property for getting an iterator of the options

* Add unit tests for option enabled/disabled

* Rename Menu -> OptionList (and friends)

The great renaming! We sort of had decided this was coming, but kept going
back and forth on if we should, what it should be, etc. Decision made today.
While this is mostly everything you want from a menu, it is foundational
enough that it needs to really be something else so it's a list of options.
Options; in a list. An OptionList.

* Add a test for adding more items to an option list later on

* Remove the debug message

I think I'm at a stage where I don't need to use it any more.

* Start of OptionList movement tests

End of day commit; more to come.

* Update the pyi for the Menu -> OptionList rename

Missed this during the grand rename.

* Tidy up a test

* Export the DuplicateID exception

* Add a test for creating a duplicate ID

* Add some more OptionList movement tests

* Allow scrollbars by default

Until the great renaming, this code was all about being menus, which
normally don't have scrollbars, and so I made a point of not having them on.
Now that this code is more about it being a list of stuff, which can be the
foundation for a menu, we want the bars there by default and any derived
menu widget can turn them off.

So here we go.

This introduces some issues that now need to be addressed. For one thing no
thought has been given to horizontal scrolling in this code (easy enough to
solve).

Also, weirdly though, the vertical scrollbars aren't quite reaching the
bottom when we highlight the last item. Wasn't expecting that, although I'm
sure there's a simple cause for that.

* Remove hover component class

I do want this, but not yet, so don't have it kicking around until I'm
actually doing something with it.

* Add missing items to the component classes docstring.

* Crop the lines that we draw

This in turn adds support for horizontal scrolling. We're not actually going
to support horizontal scrolling; in conversation with Will we've decided
that it will be *only* a vertical scrolling list, so options will be
rendered within the confines of the width.

* Allow for scrollbars by default

* Make scrolling to a non-highlight a nop rather than an error

Being able to call scroll_to_highlight even if nothing is highlighted is
useful; throwing an error when something isn't, isn't helpful. So let's make
that a no-op.

* Make a note that option ID tracking could be changed

* Ensure highlight is pulled into view on resize

It's possible that a resize might cause a highlight to partially, or even
totally, go out of view. This commit ensures that after such an event this
will be handled.

* Save an attribute access

* Microoptimise _refresh_content_tracking some more

* Reintroduce animation

But only if the vertical scrollbar is visible (see #2077 for context).

* Force a refresh when doing a specific add

* Add support for a mouse hover effect

* Highlighted a clicked option (where appropriate)

* Improve the style of a focused highlighted hovered option

* Reduce the number of attribute lookups in the line drawing method

* Simplify the way we handle page up/down at the margins

Rather than wrap around when doing page up/down, have them work as home/end
when at the margins.

* Remove unnecessary import

* Add some more option list movement tests

* Add tests for moving around an empty list

* Remove the debug message (again)

* Test moving when there are items but no highlight

* Ensure the mouse over gets cleared on clear

* Remove mouse hover logging code

It was useful while adding mouse hover support, but it's not needed now.

* Force a refresh of content tracking when doing a clear

* Rename some methods to talk about options

I want to add a `remove` for options, but widgets already have a `remove`.
So I could call it `remove_option` but then that's an imbalance with `add`.
So this renames `add` to `add_option`, and also renames `clear` to
`clear_options`.

* Add support for removing an option

* Add highlight wrapping back

I made some recent changes to highlight validation where more sensible in
the general sense, but broke the wrapping when using cursor keys to move
around. This takes that into account.

* Add tests for removing options

* Reduce the number of attribute lookups for spans

* Swap to watching highlighted to handle movement

I'd started out with an explicit refresh of the highlighted option, while
working on other things, and forgot to swap over to using a watch method.
This commit fixes that.

* Make a mouse-clicked option select that option too

* Add unit tests for option list messages

* Add unit tests for mouse hover events

* Clarify the point of the mouse click test

* Add an option list message test for highlighting a disabled option

* Add tests for interacting with disabled OptionList options

* Typo fixing

Try and make the docstring sound something approaching English.

* Fix the OptionMessage.__init__ docstring

* Add the API documentation for the OptionList

* Update the OptionTest message tests for initial highlight

Having changed things around a little regarding initial highlight, the unit
tests needed updating.

* Start the reference for the OptionList

I feel this needs a bit more work, but this feels like the core of what we
want to be emphasising.

* Add the OptionList to the gallary

* Try some extra pauses in OptionList tests

While the tests are all passing just fine locally, I'm getting the whole
whack-a-mole thing in CI that is mostly down to subtle timing issues. This
is a test to see if these extra pauses let the test apps settle down before
starting the meat of the testing.

* Try pausing in tests without setting a time

* Add snapshot tests for the OptionList examples

* Sort the bindings

* Add a docstring to the default CSS

* Explain that mouse_hovering_over can be None

* Turn mouse_hovering_over into an internal property

There was a reason that I had it as a reactive, at one point, but looking at
the final form of this code I can't see a use for it any more. So bring it
internal and make it cheaper to update.

* Update the CHANGELOG

* Update the mouse hover test after the changes to the tracking variable

* Tweak the descriptions of the hover tests

Now that I've changed this away from being a reactive.

* Tweak the OptionList hover tests some more

* Rename the up/down actions to cursor_up/down

Re: https://github.com/Textualize/textual/pull/2154#discussion_r1151587080

* Don't kick off an idle check if the widget isn't running

Added at Will's suggestion. :-P

* Simplify how we watch the vertical scrollbar status

Re: https://github.com/Textualize/textual/pull/2154#discussion_r1151593625

* Change the hover highlight to $boost

Re: https://github.com/Textualize/textual/pull/2154#discussion_r1151628190

* Add a custom exception for when an option can't be found

Re:
74a2d079b3 (r1151632957)
and 74a2d079b3 (r1151631495)

* Update tests for the new option list exceptions

* Remove the options property

We've decided it has little utility given the rest of the interface of the
widget.

Re: https://github.com/Textualize/textual/pull/2154#discussion_r1151630437

* Remove import of iterator

It's no longer required.

* Fix some option list unit tests after removing options property

* Crate Line.segments as a strip

Rather than recreate the strip every time around, just create it as a Strip
to start with. Also, in doing so, add the option meta up front rather than
every time we draw the line.

Re: https://github.com/Textualize/textual/pull/2154#discussion_r1151600239

* Correct a comment typo

* Simplify the Separator docstring

* Docstring wording tweak

* Remove the import of Segment

It's not needed any more

* Flesh out the OptionList reference some more

Things like the component classes, bindings and messages had been left out.

* Update snapshot tests

Nothing of consequence has changed but it looked like the change to how the
lines are originally constructed has resulted in an under-the-hood change to
the data that goes into a snapshot.

* Add a missing word to a docstring

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

* Fix a typo

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

* Fix a typo

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

* Document some raises that were missing

* Turn off animation

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-03-29 14:27:56 +01:00
Rodrigo Girão Serrão
9fa7de13dc Update docs with new border type.
Related PRs: #2139.
Related comments: https://github.com/Textualize/textual/pull/2139\#discussion_r1149249378
2023-03-27 16:55:26 +01:00
Will McGugan
0940546aab
compositor refactor and transparent screens (#2139)
* compositor refactor and trasparent screens

* multuple layers

* catch screen stack error

* refinement

* error messages

* capture screen stack

* new border type

* Background screen

* borders and bindings

* snapshot

* screen docs

* fix for missing screens

* screens docs

* fix for non updating transparent screens

* fix background resize

* changelog

* copy

* superfluous function

* update diagram

* inline code

* Update CHANGELOG.md

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

* Update docs/guide/screens.md

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>

* superfluous file

* Explicit None

* Apply suggestions from code review

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

* docstring

* update docstring

* docstring make property private

* Apply suggestions from code review

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

* docstring

* update docstring

* Apply suggestions from code review

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

* docstrings

* remove comment, add docstring

* Apply suggestions from code review

Co-authored-by: Dave Pearson <davep@davep.org>

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
Co-authored-by: Dave Pearson <davep@davep.org>
2023-03-27 16:44:58 +01:00
Rodrigo Girão Serrão
2a810f8c87
Implement border (sub)title. (#2064)
* Add Widget.border_title and border_subtitle.

Related issues: #1864

* Test setting border_(sub)title.

* Add border (sub)title references to StylesCache.

These internal references will make it easier for the instance of 'StylesCache' to know which border (sub)title to use, if/when needed.

* Add method to render border label.

* Add styles to align border (sub)title.

* Render border labels.

* Update styles template.

* Make new 'render_row' parameters optional.

* Add (sub)title border snapshot tests.

* Document border (sub)title and styles.

* Pass (sub)title directly as arguments.

Get rid of the watchers to make data flow easier to follow.
Related comment: https://github.com/Textualize/textual/pull/2064/files\#r1137746697

* Tweak example.

* Fix render_border_label.

This was wrong because border labels can be composed of multiple segments if they contain multiple styles. Additionally, we want to render a single blank space of padding around the title.

* Ensure we get no label when there's no space.

* Add tests for border label rendering.

* 'render_border_label' now returns iterable of segments.

* Add label to render_row.

* Fix calling signature in tests.

* Add padding to snapshot tests.

* Fix changelog.

* Update snapshot tests.

* Update snapshot tests.

* Border labels expand if there's no corners.

* Update CHANGELOG.md

* Fix docs.

* Remove irrelevant line.

* Fix snapshot tests.

* Don't share Console among tests.

* Simplify example in styles guide.

* Avoid expensive function call when possible.

* rewording

* positive branch first

* remove wasteful indirection

* fix changelog

---------

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-03-22 11:07:38 +00:00
Will McGugan
2a6368754a fix screenshot 2023-03-18 17:02:46 +00:00
Will McGugan
f5e779c4c4
tabbed content widget (#2059)
* tabbed content widget

* TabbedContent widget and docs

* missing docs

* fix active

* doc fix

* test fix

* additional test

* test for render_str

* docstring

* changelog

* doc update

* changelog

* fix bad optimization

* Update docs/widgets/tabbed_content.md

Co-authored-by: Dave Pearson <davep@davep.org>

* fix for empty initial

* docstrings

* Update src/textual/widgets/_content_switcher.py

Co-authored-by: Dave Pearson <davep@davep.org>

* docstring

* remove log

* permit nested tabs

* renamed TabsCleared to Cleared

* added tests, fix types on click

* tests

* fix broken test

* fix for nested tabs

---------

Co-authored-by: Dave Pearson <davep@davep.org>
2023-03-18 10:38:41 +00:00
Rodrigo Girão Serrão
d775a90fa2 Address review comments. 2023-03-14 14:33:10 +00:00
Rodrigo Girão Serrão
f9a1e27c6f Merge branch 'main' into add-containers
[skip ci]
2023-03-13 16:21:46 +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
Rodrigo Girão Serrão
cc8f65259e Merge branch 'main' into add-containers 2023-03-13 12:00:08 +00:00
Rodrigo Girão Serrão
0e51520a2c Make docs comply with new containers. 2023-03-13 11:44:47 +00:00
Will McGugan
9c5e0336f8
Fix scrollbar (#2024)
* Fix scrollbar

* changelog PR

* fix snapshots
2023-03-13 10:39:14 +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
Rodrigo Girão Serrão
be41797a8d Merge branch 'main' into add-containers 2023-03-09 15:19:43 +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
Rodrigo Girão Serrão
8565d3cef6 Renamed 'Vertical' to 'VerticalScroll'.
Related issues: #1957.
2023-03-08 18:31:24 +00:00
TomJGooding
e95a65fa56
docs(compound example): fix typo (#1984) 2023-03-08 17:42:25 +00:00
Will McGugan
864931e94b
Compound docs (#1952)
* compound example

* update bit switch

* prevent

* no css

* compound widget example

* more diagrams

* more diagrams

* diagrams

* words

* words

* remove sender

* removed priority post

* timer fix

* test fixes

* drop async version of post_message

* extended docs

* fix no app

* Added control properties

* changelog

* changelog

* changelog

* fix for stopping timers

* changelog

* docs update

* last byte example

* new section

* update of byte03

* updae to docs

* Added compound examples

* Rewording

* Use set sender

* don't need this

* hyphens

* Update docs/guide/widgets.md

Co-authored-by: Dave Pearson <davep@davep.org>

* Update docs/guide/widgets.md

Co-authored-by: Dave Pearson <davep@davep.org>

* Update docs/guide/widgets.md

Co-authored-by: Dave Pearson <davep@davep.org>

* Update docs/guide/widgets.md

Co-authored-by: Dave Pearson <davep@davep.org>

* Update docs/guide/widgets.md

Co-authored-by: Dave Pearson <davep@davep.org>

* Update docs/guide/widgets.md

Co-authored-by: Dave Pearson <davep@davep.org>

* Update docs/guide/widgets.md

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

* Update docs/guide/widgets.md

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

* Update docs/guide/widgets.md

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

* Update docs/guide/widgets.md

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

* parenthesis

* stack diagram

---------

Co-authored-by: Dave Pearson <davep@davep.org>
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-03-06 16:56:24 +00:00
Rodrigo Girão Serrão
294213e0a1
Update radio_set_changed.py (#1947)
In the aftermath of #1935 and #1940 this fell through the cracks.
2023-03-06 12:04:22 +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
Will McGugan
373fc95fc1
Drop explicit sender attribute from messages (#1940)
* remove sender

* removed priority post

* timer fix

* test fixes

* drop async version of post_message

* extended docs

* fix no app

* Added control properties

* changelog

* changelog

* changelog

* fix for stopping timers

* changelog

* added aliases to radio and checkbox

* Drop sender from Message init

* drop time

* drop cast

* Added aliases
2023-03-06 10:52:34 +00:00
Dave Pearson
6d0fc0489f
Rework the layout of the checkbox example
Time to start to show off the new compose method.
2023-02-27 09:11:18 +00:00
Dave Pearson
23c0587efb
Rework the layout of the radio button example
Time to start to show off the new compose method.
2023-02-27 09:10:10 +00:00
Dave Pearson
f436489efa
Rework the layout of the radio set example
Time to start to show off the new compose method.
2023-02-27 09:08:40 +00:00
Dave Pearson
e6e46d0825
Merge branch 'main' into toggle-boxen 2023-02-27 08:53:30 +00:00
Will McGugan
9c1f6f7fad Added docs for the new compose method 2023-02-26 10:34:30 +00:00
Will McGugan
63438f170d
Update docs/examples/events/prevent.py
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-02-24 12:02:56 +00:00
Will McGugan
217956bbdf
Update docs/examples/events/prevent.py
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-02-24 12:02:46 +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
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
Dave Pearson
a3d50d90f6
Revert example code to composing the old way
We've not documented it yet so, until we do...
2023-02-23 15:09:45 +00:00
Dave Pearson
87bd610eec
Swap the checkbox example to the newer compose approach 2023-02-23 14:45:24 +00:00
Will McGugan
da9e28d4d6 Add example 2023-02-23 14:41:44 +00:00
Dave Pearson
01215a1fe8
Tweak the style of the box in the example for checkbox 2023-02-23 14:40:58 +00:00
Dave Pearson
3fd3d272ce
Add the widget reference for Checkbox 2023-02-23 14:26:11 +00:00
Will McGugan
11d10db1ab fast path for scrolling 2023-02-17 10:42:42 +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
71d0017ef9 docs and refactor 2023-02-14 15:22:15 +00:00
darrenburns
bd73b1b007
Merge branch 'main' into datatable-cell-keys 2023-02-13 16:02:37 +00:00
Will McGugan
a37e7fcb2b fix modal example 2023-02-11 15:37:24 +00:00
Darren Burns
f4cd51e5e8
Merge branch 'main' of github.com:Textualize/textual into datatable-cell-keys 2023-02-09 15:55:45 +00:00
Dave Pearson
1956f7f9d7
Rename the switch--switch component class to switch--slider
Following on from #1751: originally Switch was called Checkbox and the
moving part was, for the component class, called a checkbox--switch; after
renaming the widget to Switch that component class ended up being
switch--switch; which wasn't ideal.

We decided to go with it as-is, but I just realised that internally the code
calls it a slider. So this leans into that and I'm renaming the component
class switch--slider. This removes the doubling-up of the name and also
makes the code more consistent.
2023-02-09 15:36:04 +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
Darren Burns
20b8782a5d Unit tests for DataTable reverse sort 2023-02-08 12:54:15 +00:00
Rodrigo Girão Serrão
e5e7c08afe Update docs accordingly. 2023-02-08 10:53:51 +00:00
Darren Burns
0721d7fc87 Snapshot test for sorting 2023-02-08 10:39:04 +00:00
Darren Burns
802ea63ddb
Default cell formatter fixes 2023-02-07 15:09:21 +00:00
Will McGugan
fb7fd14262
Merge pull request #1710 from Textualize/line-api-docs
Documented the Line API
2023-02-06 11:42:57 +00:00
Will McGugan
f8577f79d7 review fixes 2023-02-06 11:34:37 +00:00
Will McGugan
fb7c1642bc Checker example 4, docs and diagram 2023-02-04 15:40:36 +01:00
Will McGugan
25b498896d checker 4 and diagram 2023-02-04 11:28:07 +01:00
Will McGugan
a5808db8b8 more docs and diagrams 2023-02-03 19:10:03 +01:00
Will McGugan
2ff278874b docs examples and diagrams 2023-02-03 11:23:14 +01:00
Will McGugan
8ce76f4f89 fix title update 2023-02-01 18:01:34 +01:00
Will McGugan
806c80b8fe simplify 2023-02-01 17:14:53 +01:00
Will McGugan
0a5838d964 checker example 2023-02-01 16:26:55 +01:00
Rodrigo Girão Serrão
828d8d2cf1 Replace Static with Label. 2023-01-31 17:31:36 +00:00
Rodrigo Girão Serrão
c14f635244 Document setting app (sub)title. 2023-01-31 17:31:06 +00:00
Rodrigo Girão Serrão
0f3aff6fb1
Merge pull request #1408 from Textualize/review-styles-reference
Review styles reference
2023-01-10 14:20:11 +00:00
Ofek Lev
9b779c130d
Fix typo 2023-01-10 01:42:16 -05:00
Rodrigo Girão Serrão
d41471034a Fix failing tests. 2023-01-09 16:39:12 +00:00
Rodrigo Girão Serrão
130d8b8d05 Increase negative y offset. 2023-01-09 16:34:24 +00:00
Rodrigo Girão Serrão
15691b4451 Remove debugging style. 2023-01-09 16:34:06 +00:00
Rodrigo Girão Serrão
a1b9d4b2c5 Fix examples. 2023-01-09 16:11:45 +00:00
Rodrigo Girão Serrão
2827edcd49 Add example with all padding types. 2023-01-09 15:43:34 +00:00
Rodrigo Girão Serrão
71b859b6e2 Add thorough example for all outlines. 2023-01-09 13:49:32 +00:00
Rodrigo Girão Serrão
aad41b8de0 Fix height example.
[skip ci]
2023-01-07 09:44:39 +00:00
Rodrigo Girão Serrão
8de6d8fd69 Add new width comparison example. 2023-01-07 09:40:03 +00:00
Darren Burns
ad6a716d09 Fix mouse01 example background transparency 2023-01-07 09:35:00 +00:00
Rodrigo Girão Serrão
2217a8f5fa Add new visibility example.
This new example shows how we can have an invisible container with visible children.
2023-01-06 16:38:31 +00:00
Rodrigo Girão Serrão
d69168a922 Update visibility example to use labels. 2023-01-06 16:37:41 +00:00
Rodrigo Girão Serrão
ee4b2cfe9e Update tint example to use labels. 2023-01-06 14:53:07 +00:00
Darren Burns
387a045cff
Fix mouse01 example background transparency 2023-01-06 14:32:23 +00:00
Rodrigo Girão Serrão
72d3171a79 Add example with all text styles. 2023-01-06 14:18:21 +00:00
Rodrigo Girão Serrão
1276629431 Update example. 2023-01-06 14:18:07 +00:00
Rodrigo Girão Serrão
c7c352a38a Replace statics with labels.
[skip ci]
2023-01-06 10:56:55 +00:00
Rodrigo Girão Serrão
042bc3b3fe Improve text-align example.
Replace statics with labels; change to a 2 x 2 grid layout to make it easier to see the difference between 'center' and 'justify'; increase readability by setting 'color: auto' in the labels.
2023-01-06 10:41:46 +00:00
Rodrigo Girão Serrão
710697121d Merge branch 'main' into review-styles-reference
[skip ci]
2023-01-06 10:05:16 +00:00
Rodrigo Girão Serrão
f457afd826 Add example for all scrollbar size rules. 2023-01-05 12:01:41 +00:00
Rodrigo Girão Serrão
5b6bedd8c6 Fix example to use labels. 2023-01-05 12:01:23 +00:00
Rodrigo Girão Serrão
9b53c7a704 Update base scrollbar example. 2023-01-04 17:10:12 +00:00
Rodrigo Girão Serrão
14f0240d6a Add example for (background) scrollbar active/hover. 2023-01-04 17:09:58 +00:00
Rodrigo Girão Serrão
7fb00f531c Add example for corner colors. 2023-01-04 17:09:35 +00:00
Rodrigo Girão Serrão
454d36cdc7 Use labels instead of static. 2023-01-04 11:43:38 +00:00
Rodrigo Girão Serrão
52497172b0 Add example to compare border and outline. 2023-01-04 10:34:37 +00:00
Rodrigo Girão Serrão
0fe5a98033 Use labels instead of statics. 2023-01-04 10:34:22 +00:00
Rodrigo Girão Serrão
bebd054e5e Update opacity example. 2022-12-22 18:38:14 +00:00
Rodrigo Girão Serrão
289ec2556b Tweak example for offset. 2022-12-22 18:00:52 +00:00
Rodrigo Girão Serrão
d0c744d8d9 Add examples for min/max width/height. 2022-12-22 17:45:55 +00:00
Rodrigo Girão Serrão
164678ab66 Fix reference for layout. 2022-12-22 14:05:17 +00:00
Rodrigo Girão Serrão
e789c9c006 Use labels instead of statics. 2022-12-21 16:49:27 +00:00
Rodrigo Girão Serrão
a617d4091c Add example with all margin rules. 2022-12-21 16:48:43 +00:00
Rodrigo Girão Serrão
57af822730 Add example for link hover style. 2022-12-20 18:47:22 +00:00
Rodrigo Girão Serrão
8ce8b4c33a Add example for link hover background. 2022-12-20 18:47:15 +00:00
Rodrigo Girão Serrão
e68e02405f Add example for link hover color. 2022-12-20 18:47:05 +00:00
Rodrigo Girão Serrão
47ef2aa73f Add example for link style. 2022-12-20 18:46:44 +00:00
Rodrigo Girão Serrão
8138961f60 Add example for link background. 2022-12-20 18:46:33 +00:00
Rodrigo Girão Serrão
4aad7cda89 Add example for link color. 2022-12-20 17:29:57 +00:00
Rodrigo Girão Serrão
6451d192a6 Reorder CSS rule by relevance. 2022-12-20 11:16:31 +00:00
Rodrigo Girão Serrão
591e343a5a Add example to compare all heights. 2022-12-20 10:40:13 +00:00
Rodrigo Girão Serrão
0ccc2bbc00 Add example for column-span. 2022-12-19 18:44:48 +00:00
Rodrigo Girão Serrão
5ff0f79720 Add example for row-span. 2022-12-19 18:42:45 +00:00
Rodrigo Girão Serrão
50ee4e57f2 Add example for grid-gutter. 2022-12-19 18:42:28 +00:00
Rodrigo Girão Serrão
5e901458fb Add grid size examples. 2022-12-19 18:01:29 +00:00
Rodrigo Girão Serrão
da51877941 Add example for grid columns. 2022-12-19 17:50:13 +00:00
Rodrigo Girão Serrão
18a006607c Add example for grid rows. 2022-12-19 17:49:55 +00:00
Rodrigo Girão Serrão
9c10dcf80e Add dock example with four docks. 2022-12-15 18:59:57 +00:00
Rodrigo Girão Serrão
378f25a2b4 Add example app with content alignment grid. 2022-12-15 18:10:22 +00:00
Rodrigo Girão Serrão
ddd2e25038 Change statics to labels. 2022-12-15 18:10:02 +00:00
Rodrigo Girão Serrão
decdc892e9 Add example to show auto selection of text color. 2022-12-15 17:25:39 +00:00
Rodrigo Girão Serrão
f0ea8a8664 Replace statics with labels. 2022-12-15 17:25:16 +00:00
Rodrigo Girão Serrão
e70f271afc Add example with all border types. 2022-12-15 16:15:30 +00:00
Rodrigo Girão Serrão
3a83c26779 Replace statics with labels. 2022-12-15 16:14:56 +00:00
Rodrigo Girão Serrão
afac92439c Add example for background transparency. 2022-12-14 14:35:11 +00:00
Darren Burns
1acc36084b Add non-printable key to footer snapshot 2022-12-14 14:07:26 +00:00
Rodrigo Girão Serrão
2faff2fbfc Add complete alignment grid screenshot. 2022-12-13 18:30:14 +00:00
Rodrigo Girão Serrão
26a9e3fced Use Label for simple text widgets. 2022-12-13 18:29:55 +00:00
Will McGugan
9aac3a0cca updated list view 2022-12-10 18:18:28 +00:00
Will McGugan
c76d616521 updated snapshot 2022-12-10 17:54:57 +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
Will McGugan
7ba70ada96 fix examples 2022-12-08 17:24:34 +00:00
Will McGugan
a6e64a38ee fix for snapshot 2022-12-07 16:58:26 +00:00
Will McGugan
dd8a9562d0 fix for container height change 2022-12-07 16:02:51 +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
Darren Burns
f0c4023c47
Merge branch 'main' of github.com:Textualize/textual into list-view 2022-11-30 12:15:08 +00:00
chillerno1
aea5905179 Add missing type hints to methods 2022-11-28 11:40:27 +11:00
Rodrigo Girão Serrão
9654748dd7 Update example and test files. 2022-11-25 18:23:24 +00:00
Rodrigo Girão Serrão
9fd01494b9
Merge pull request #1243 from jangxyz/patch-1
FIX css link
2022-11-23 20:49:48 +00:00
Darren Burns
eb8c078306 Merge branch 'main' of github.com:willmcgugan/textual into list-view 2022-11-23 11:03:40 +00:00
Kim, Jang-hwan
d58a072dfc
FIX css link
This is the part where the [guide](https://textual.textualize.io/guide/widgets/#default-css) explains the `DEFAULT_CSS` feature, leaving a small amount of css in `hello04.css`. However, the App class still links to the css file from the previous version (`hello03.css`). This PR fixes that and updates to the recent one.
2022-11-22 07:59:02 +09:00
Darren Burns
be318949f8
Fix snapshot test 2022-11-21 17:10:16 +00:00
Darren Burns
c57f6b9025
Fix click handler 2022-11-21 16:42:53 +00:00
Darren Burns
eafb9eca8e
Adding example for list itemm 2022-11-21 15:12:36 +00:00
Will McGugan
f7dade5a26 new tree control 2022-11-20 15:42:35 +00:00
Rodrigo Girão Serrão
54b85399e7
Merge branch 'main' into placeholder 2022-11-18 15:21:40 +00:00
Rodrigo Girão Serrão
a8c5d1abe4 Add docs for Placeholder. 2022-11-18 15:17:43 +00:00
Dave Pearson
8a6d21da5e
Add the basics of Label docs for the manual 2022-11-17 10:15:35 +00:00
Will McGugan
39a764f49f call later 2022-11-09 17:23:28 +00:00
Dave Pearson
dcf1784676
Merge pull request #1017 from UriyaHarpeness/feature/fix-some-inaccuracies-in-the-tutorial
Fix some inaccuracies in the tutorial.
2022-10-31 13:11:02 +00:00
hfarooq
0963103db8 Fixed data_table example app - actually run it 2022-10-25 21:03:51 +00:00
UriyaHarpeness
98fdb9d1a1 Fix some inaccuracies in the tutorial. 2022-10-25 19:32:14 +03:00
Darren Burns
d02e6e94b0
Fix data-table snapshot 2022-10-24 15:16:47 +01:00
Darren Burns
041bb35014
Remove comments, simplify test 2022-10-24 14:51:40 +01:00
Darren Burns
f09e5f7d9f
Snapshot testing footer 2022-10-24 12:39:33 +01:00
Darren Burns
67c3b83f80
Remove animation from checkbox snapshot test 2022-10-24 12:18:35 +01:00
Darren Burns
c6418e5e20
Snapshot testing data table, checkbox interactions 2022-10-24 12:14:52 +01:00
Darren Burns
5d4ff6614f
Snapshotting canonical style property examples 2022-10-20 15:26:01 +01:00
Dave Pearson
76e9654535
Merge pull request #958 from davep/toll-free
Review the use of the bell in various examples and documentation files
2022-10-19 15:56:21 +01:00
Dave Pearson
c4f920be67
Remove the bell from the Button documentation example 2022-10-19 15:15:53 +01:00
Dave Pearson
e8bb084538
Remove intro02.py
It doesn't appear to be referenced anywhere in the docs.
2022-10-19 15:12:54 +01:00
Dave Pearson
bd0e1c01b1
Remove intro01.py
It doesn't appear to be referenced anywhere in the docs.
2022-10-19 15:12:11 +01:00
Dave Pearson
f8bda04d90
Remove the on_space from key01 in the docs
While in this part of the docs we do want to keep the bell (see key02), it
was an error in the code that it included this event in key01. Removing it
from here because adding this bit of code for key02 is a key (no pun) part
of the docs.
2022-10-19 15:05:18 +01:00
Dave Pearson
ce0c6c49a2
Remove the bell from the actions05 documentation example 2022-10-19 14:59:59 +01:00
Dave Pearson
f76e472096
Remove the bell from the actions04 documentation example 2022-10-19 14:57:50 +01:00
Dave Pearson
aa8580bee7
Remove the bell from the actions03 documentation example 2022-10-19 14:54:57 +01:00
Dave Pearson
5c5ca3316f
Remove the bell from the actions02 documentation example 2022-10-19 14:43:37 +01:00
Dave Pearson
f5ce603d43
Remove the bell from the actions01 documentation example 2022-10-19 14:41:13 +01:00
darrenburns
4a0dc49bca
Checkbox polishing + fix auto-width in Horizontal layout (#942)
* checkbox widget

* fixes

* Checkbox additions, fix content width in horizontal layout

* Update docs, add tests for checkbox

* Remove some test code

* Small renaming of test class

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2022-10-18 15:17:44 +01:00
Dave Pearson
78ea2cd9f8
Modify the screen examples to import Screen from textual.screen
The surrounding text in the documentation states that Screen is imported
from textual.screen, but the code was importing the class from textual.app.
Further, I was getting warnings from pyright that I was using a class that
wasn't exported from the module I was importing from.
2022-10-13 09:10:40 +01:00
Darren Burns
3619b8f27a
Make example link italic in dos 2022-10-11 11:26:04 +01:00
Darren Burns
ba94892bdd
Remove CSS that wasnt needed 2022-10-11 11:22:46 +01:00
Darren Burns
f6452bbbd5
Styles documentation for links properties 2022-10-11 11:22:24 +01:00
Will McGugan
e2ea2cf7ef
Merge pull request #854 from Textualize/styles-css-property-fixes-updates
Fix issues with `Styles.css`, update "Grid" styles doc page
2022-10-08 16:02:12 +01:00
Will McGugan
4ff99bc72c remove hack 2022-10-08 14:55:01 +01:00
Will McGugan
f2f13eacf0 proof reading 2022-10-07 18:00:35 +01:00
Darren Burns
143332efd5
Add example to grid styles docs, rename it 2022-10-07 14:59:37 +01:00
Will McGugan
58ed906ed5 simplified animator docs 2022-10-06 15:59:42 +01:00
Darren Burns
99aa17214e
Merge branch 'css' of github.com:Textualize/textual into docs-animator 2022-10-06 14:11:19 +01:00
Darren Burns
533ec72029
Finish up Animator docs first pass 2022-10-06 14:11:08 +01:00
Will McGugan
994ced1648 table example 2022-10-06 11:13:48 +01:00
Darren Burns
21ee43325d Animator docs, wait syntax in app.run keys 2022-10-05 17:24:03 +01:00
Will McGugan
38ad103a79
Merge pull request #824 from Textualize/docs-screen
Docs screen
2022-10-05 10:55:49 +01:00
Will McGugan
f6e3cc6517 screens api 2022-10-04 17:48:25 +01:00
Darren Burns
4e521a2421 Merge branch 'css' of github.com:willmcgugan/textual into docs-widgets 2022-10-04 17:14:02 +01:00
Darren Burns
ad610e61cd Example app showing input 2022-10-04 15:30:53 +01:00
Darren Burns
8225b43ac1 Document Static widget 2022-10-04 13:35:56 +01:00
Darren Burns
14af7be6fd Document Header widget 2022-10-04 11:43:30 +01:00
Darren Burns
ec14ed25d2 Document Footer widget 2022-10-04 11:26:23 +01:00
Will McGugan
86a7bef71f replace references to TextInput 2022-10-03 17:38:10 +01:00
Will McGugan
9de1a87024 more docs and compute example 2022-10-03 16:55:40 +01:00
Will McGugan
e61eaf7597 replace TextInput with Input 2022-10-01 14:43:46 +01:00
Will McGugan
5f97bbd33f actions docs 2022-09-29 16:33:19 +01:00
Will McGugan
d962dcd49c new align 2022-09-27 16:35:40 +01:00
Will McGugan
28d395f774 code in events 2022-09-26 10:41:36 +01:00
Will McGugan
3f0955cbe5 fix tests 2022-09-26 09:51:33 +01:00
Will McGugan
53d8e02d0d input docs an exampels 2022-09-24 17:04:00 +01:00
Will McGugan
bb0e754329 fizzbuzz examples 2022-09-23 13:25:04 +01:00
Will McGugan
4437c7b640 hello examples 2022-09-22 18:16:02 +01:00
Will McGugan
9ab01d3c54 widgets docs 2022-09-21 17:18:50 +01:00
Will McGugan
24d4491bf8 doc screenshots 2022-09-20 18:16:03 +01:00