Files
textual/docs/examples/styles
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
..
2022-09-27 16:35:40 +01:00
2022-12-13 18:29:55 +00:00
2023-01-09 16:11:45 +00:00
2023-01-09 16:11:45 +00:00
2023-01-09 16:11:45 +00:00
2022-12-15 16:14:56 +00:00
2023-01-09 16:11:45 +00:00
2022-08-13 21:39:31 +01:00
2023-01-09 16:11:45 +00:00
2022-12-15 17:25:16 +00:00
2022-12-19 18:44:48 +00:00
2022-12-19 18:44:48 +00:00
2022-12-15 18:10:02 +00:00
2022-12-15 18:10:02 +00:00
2023-01-09 16:11:45 +00:00
2022-08-13 21:39:31 +01:00
2022-12-15 18:59:57 +00:00
2022-12-15 18:59:57 +00:00
2022-12-19 17:50:13 +00:00
2022-12-19 17:50:13 +00:00
2023-01-09 16:11:45 +00:00
2022-12-19 18:42:28 +00:00
2022-12-19 17:49:55 +00:00
2022-12-19 17:49:55 +00:00
2022-12-19 18:01:29 +00:00
2022-12-19 18:01:29 +00:00
2022-12-19 18:01:29 +00:00
2022-12-19 18:01:29 +00:00
2023-02-17 10:42:42 +00:00
2023-01-09 16:11:45 +00:00
2022-08-13 21:39:31 +01:00
2022-12-22 14:05:17 +00:00
2022-12-22 14:05:17 +00:00
2022-12-20 17:29:57 +00:00
2022-12-20 17:29:57 +00:00
2022-12-20 18:46:44 +00:00
2022-12-20 18:46:44 +00:00
2022-10-11 11:26:04 +01:00
2023-01-09 16:39:12 +00:00
2022-12-21 16:49:27 +00:00
2023-01-09 16:34:24 +00:00
2023-01-09 16:34:24 +00:00
2022-12-22 18:38:14 +00:00
2022-12-22 18:38:14 +00:00
2023-01-09 16:34:06 +00:00
2023-01-09 16:39:12 +00:00
2023-01-04 10:34:22 +00:00
2023-01-09 16:39:12 +00:00
2023-01-04 11:43:38 +00:00
2022-07-30 22:33:55 +01:00
2022-12-19 18:42:45 +00:00
2022-12-19 18:42:45 +00:00
2022-08-19 15:35:31 +01:00
2022-08-19 15:35:31 +01:00
2023-01-05 12:01:23 +00:00
2023-03-13 10:39:14 +00:00
2023-01-04 17:10:12 +00:00
2023-01-04 17:10:12 +00:00
2023-01-06 10:41:46 +00:00
2023-01-06 10:41:46 +00:00
2023-01-06 10:56:55 +00:00
2023-01-06 10:56:55 +00:00
2023-01-06 14:18:07 +00:00
2023-01-06 14:18:07 +00:00
2023-01-09 16:11:45 +00:00
2023-01-09 16:11:45 +00:00
2023-01-09 16:11:45 +00:00
2022-08-14 15:43:00 +01:00
2022-08-14 15:43:00 +01:00

These are the examples from the documentation, used to generate screenshots.

You can run them with the textual CLI.

For example:

textual run text_style.py