Commit Graph

44 Commits

Author SHA1 Message Date
Will McGugan
074bfd7e2f Headings 2023-04-07 11:56:00 +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
Dave Pearson
e6f620db44 Remove underscore pauses from (hopefully) all snapshots
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.
2023-03-09 20:32:27 +00:00
Dave Pearson
05b3ab6c78 Refine the explanation of percentage
Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-01-18 10:05:40 +00:00
Dave Pearson
330950e6b0 Seek to improve the explanation of what a percentage does
I've seen a couple or so folk get confused about what a percentage value for
a dimension means, often seeming to think it means that percentage of
the *remaining* space within a container as opposed to a percentage of the
space in the container (note total space, not remaining space).

I'm not sure the wording here is the final form we want (there's more
mention of "dimension" here than your average Star Trek or Doctor Who
episode!), but I think it's narrowing in on it.

Making this change to place-hold the need to improve this and perhaps gather
some input to find the best final wording.
2023-01-17 16:33:30 +00:00
Sundeep Agarwal
dffdb63e9d fixed typos 2022-11-28 10:17:26 +05:30
Rodrigo Girão Serrão
bc1298b85b Pause so that screenshots are not empty. 2022-11-23 17:09:53 +00:00
Dave Pearson
e280719816 Singular style 2022-10-13 22:14:14 +01:00
Dave Pearson
e583d21165 it's -> its 2022-10-13 22:10:46 +01:00
Dave Pearson
c37c5569d7 Add what appears to be a missing "at" 2022-10-13 22:01:16 +01:00
Dave Pearson
bfed4a6bf9 Fix the mention of an example to be singular 2022-10-13 22:00:17 +01:00
Dave Pearson
19c29bdb11 Add code markup to string constants
Elsewhere in the document colour names as strings have been marked up as
text, so this is in keeping with that.
2022-10-13 21:57:08 +01:00
Dave Pearson
279b043c81 Add missing plural 2022-10-13 21:55:49 +01:00
Dave Pearson
bd21a255ad Add missing "we" 2022-10-13 21:53:16 +01:00
Dave Pearson
8b45cd5324 Remove trailing whitespace 2022-10-13 21:49:46 +01:00
Aaron Stephens
b9493ae6ff docs: typos 2022-10-12 17:34:29 -07:00
Will McGugan
f2f13eacf0 proof reading 2022-10-07 18:00:35 +01:00
Will McGugan
66a4e08955 words 2022-10-07 17:20:26 +01:00
Will McGugan
d962dcd49c new align 2022-09-27 16:35:40 +01:00
Will McGugan
9838d3b34e fluid rendering 2022-09-18 11:25:16 +01:00
Will McGugan
43de22e3b3 tabs for content-box etc 2022-09-15 12:11:02 +01:00
Will McGugan
0276f54e9b Update docs/guide/styles.md
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2022-09-15 11:21:21 +01:00
Will McGugan
b617878067 link to diagram 2022-09-15 11:15:28 +01:00
Will McGugan
9d7e58cfd3 Update docs/guide/styles.md
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2022-09-15 11:15:00 +01:00
Will McGugan
09dcab081f Update docs/guide/styles.md
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2022-09-15 11:11:03 +01:00
Will McGugan
54bcb2b4ed Update docs/guide/styles.md
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2022-09-15 11:10:40 +01:00
Will McGugan
9718d38323 Update docs/guide/styles.md
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2022-09-15 11:10:10 +01:00
Will McGugan
fe500f9a94 words 2022-09-15 11:09:11 +01:00
Will McGugan
41b3ff6855 fix examples 2022-09-15 11:08:47 +01:00
Will McGugan
0624fb8507 Update docs/guide/styles.md
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2022-09-15 11:07:35 +01:00
Will McGugan
950477b9ff Update docs/guide/styles.md
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2022-09-15 11:06:40 +01:00
Will McGugan
095b0dfcac Update docs/guide/styles.md
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2022-09-15 11:04:40 +01:00
Will McGugan
855be4481a edits 2022-09-15 09:31:12 +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
32079fc8f7 color docs 2022-09-11 10:25:51 +01:00
Will McGugan
b6341ddb50 added color reference and docs 2022-09-10 22:00:51 +01:00
Will McGugan
269960ad8a fix styles examples, box model docs 2022-09-10 16:45:13 +01:00
Will McGugan
39c6dee84f styles docs 2022-09-10 16:12:35 +01:00
Will McGugan
d9d5791925 todos 2022-09-06 15:39:41 +01:00
Will McGugan
3e41e14714 box diagram 2022-09-06 10:50:12 +01:00
Will McGugan
6d6e385313 added styles 2022-09-05 22:58:15 +01:00