* 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.
* Allow setting an additional alpha on a border
See #1863.
* Update the ChangeLog
* Add snapshot tests for the border alpha value
* Extend the border snapshot tests
While this doesn't test *every* permutation, it covers enough bases that if
something were to change it should catch it.
* Tweak a typo in the border style examples
* Add border transparency percentage to the border docs
* Add a CSS example for using border transparency
* Add Color.multiply_alpha
* Update the CHANGELOG
* Multiply the alpha on a colour rather than replace it
As requested in
https://github.com/Textualize/textual/pull/1954#pullrequestreview-1328170386
(actually required while talking in person with Will, but noted in the
above)
* Multiply the alpha on a border colour rather than replace it
As requested in
https://github.com/Textualize/textual/pull/1954#pullrequestreview-1328170386
(actually requested while talking in person with Will, but noted in the
above)
To the best of my knowledge, and in testing myself, border and border_* are
properties of a widget's `styles` property, they're not a property of the
widget itself.
Supposedly, this had been done in an earlier commit for all styles. Apparently, I forgot to open styles references that were one level deeper in the directory, so the pages about grid, links, and scrollbar colors still included the css types values directly in their reference pages.
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.