* 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 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.
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.
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.
* Initial layout guide stuff
* More docs on layout - grid
* Continuing grid docs
* Grid gutter and spans guide
* Improvements to layout docs for horizontal, vertical, dock, and begin describing layers
* Update center layout example to reflect new yield order
* More updates to layout guide, mostly offset stuff
* More layout guide, "Putting it all together"
* Updates to layout guide page
* Small rewording of dock layout in guide
* Apostrophe
* Typo
* Small design tweak to combining layouts example
* Typos, tidying up
* Small reword
* Some updates to docs/guide/layout/grid
* calc fix
Co-authored-by: Will McGugan <willmcgugan@gmail.com>