* 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>
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.
* 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
While the code here isn't exactly written as a play-along tutorial, it's
reasonable to expect that some one can and will. This commit has been
written because exactly that situation happened.
The problem here is without the ID on the label the layout will end up
looking very different from that shown in the docs; which will halt the
reader's flow as they try and figure out what they did wrong.
Counterpoint: this is a guide, not a tutorial, so it seemed reasonable to
only highlight the important thing that's changing. Personally I think I'd
argue in favour of highlighting all the changes from question01 to
question02.
Addresses #1905.
Note that this doesn't touch the application of stylesheets yet, in terms of
things like specificity; this just makes sure that the classes exist and can
be seen.
As well as not being necessary for the example, it also had the problem of
not actually having the input in focus (there was no press of 'tab' to kick
things off) and so the other keys didn't go into the `Input` as they were
supposed to.
I've seen a couple or so folk get confused about what a percentage value for
a dimension means, often seeming to think it means that percentage of
the *remaining* space within a container as opposed to a percentage of the
space in the container (note total space, not remaining space).
I'm not sure the wording here is the final form we want (there's more
mention of "dimension" here than your average Star Trek or Doctor Who
episode!), but I think it's narrowing in on it.
Making this change to place-hold the need to improve this and perhaps gather
some input to find the best final wording.