Commit graph

8 commits

Author SHA1 Message Date
Sepehr Shirkhanlu
5153fe6c92
Fix docs (#2932)
* Fix line highlighting in docs

* fix docs: remove duplicated code
2023-07-23 16:49:59 +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
d0293c2c89 changed to CSS_PATH 2022-09-18 22:02:08 +01:00
Will McGugan
8a31523e09 doc fixes 2022-09-14 17:54:27 +01:00
Will McGugan
9816c2643f more docs and diagrams 2022-09-14 17:09:38 +01:00
Will McGugan
e85f9dc045 dimensions 2022-09-14 13:19:45 +01:00
Will McGugan
4a459dbd20 Added compose event, more color docs 2022-09-12 12:47:14 +01:00
Will McGugan
269960ad8a fix styles examples, box model docs 2022-09-10 16:45:13 +01:00