* 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>
* Remove _clock.py::sleep.
* Move _clock.py::get_time_no_wait to _time.py.
* Move _clock.py::get_time to _time.py.
* Remove async version of _time.py::get_time.
We started by removing '_time.py::get_time' because that was the async one and then I renamed 'get_time_no_wait' to 'get_time'.
* Make 'get_time' just an alias.
The start of what will hopefully become a one-stop comprehensive test of all
the fun corners of stylesheet parsing. While not intended to replace all the
other unit tests for CSS, this test should help to quickly and easily be
sure that nothing breaks any valid CSS.
Influenced by #1253 and #1836 this code starts the process of implementing
the requirement outlined in #1838.
Adding more rules -- simple and/or weird -- that are expected and known to
parse without a problem is encouraged.
Initially this was "throw most if not all widgets at the display and disable
everything" test; but in #2028 it was requested that this be simplified,
just using the same widget, in enabled and disabled states.
Button seems like a good choice here.
To ensure that things work as intended, I'm going with the approach of
disabling via a container as that's one big change that the disabled
facility brought in.