Commit Graph

185 Commits

Author SHA1 Message Date
Rodrigo Girão Serrão
48d0547d86 Merge branch 'main' into fix-2107 2023-03-23 11:04:21 +00:00
Rodrigo Girão Serrão
559f976f78 Add more consistent phrasing.
Related issues: #2107
2023-03-23 11:04:17 +00:00
Rodrigo Girão Serrão
f9922ebe29 Improve subsection titles.
Related issues: #2108
Related PRs: #2110, #2064
2023-03-22 23:00:13 +00:00
Will McGugan
9529cac352 Version 0.16.0 (#2106)
* snapshot

* words

* word update
2023-03-22 13:38:23 +00: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
Rodrigo Girão Serrão
285de4b0fa Merge branch 'main' into add-containers 2023-03-14 14:35:23 +00:00
Dave Pearson
b9c6520db4 Make the Python code for dock.md more... Pythonic (#2046)
Fixes #2043.
2023-03-14 09:47:51 +00:00
Rodrigo Girão Serrão
cc8f65259e Merge branch 'main' into add-containers 2023-03-13 12:00:08 +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
Rodrigo Girão Serrão
8565d3cef6 Renamed 'Vertical' to 'VerticalScroll'.
Related issues: #1957.
2023-03-08 18:31:24 +00:00
Dave Pearson
b7de48cca3 Border colour percentage (#1954)
* 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)
2023-03-07 14:14:17 +00:00
Dave Pearson
fcc16c0e59 Correct the example Python code for the border style (#1956)
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.
2023-03-07 09:28:02 +00:00
Rodrigo Girão Serrão
e1d36e5be8 Minor doc fixes. 2023-01-10 14:45:37 +00:00
Rodrigo Girão Serrão
130d8b8d05 Increase negative y offset. 2023-01-09 16:34:24 +00:00
Rodrigo Girão Serrão
a3a452b674 Highlight rule usage in references.
[skip ci]
2023-01-09 16:14:11 +00:00
Rodrigo Girão Serrão
2827edcd49 Add example with all padding types. 2023-01-09 15:43:34 +00:00
Rodrigo Girão Serrão
e81779f97c Add 'See also' sections to references. 2023-01-09 15:25:47 +00:00
Rodrigo Girão Serrão
8bf211b898 Fix typo. 2023-01-09 14:14:14 +00:00
Rodrigo Girão Serrão
1300807b3a Put example outputs in first tab. 2023-01-09 13:57:04 +00:00
Rodrigo Girão Serrão
e7afcbc0b5 Add reference to 'textual borders' command. 2023-01-09 13:52:02 +00:00
Rodrigo Girão Serrão
dd6e73aa39 Add subsections for references with 2+ examples. 2023-01-09 13:50:45 +00:00
Rodrigo Girão Serrão
da9a481f1c Remove inclusion of old css types snippets.
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.
2023-01-09 11:28:47 +00:00
Rodrigo Girão Serrão
196d430582 Style all Textual CSS as 'sass'
Textual CSS is better highlighted in SASS code blocks because the SASS parser seems to be more lenient.
2023-01-09 11:20:04 +00:00
Rodrigo Girão Serrão
c0d7f7cebf Add note about Textual limitation. 2023-01-07 09:47:56 +00:00
Rodrigo Girão Serrão
aad41b8de0 Fix height example.
[skip ci]
2023-01-07 09:44:39 +00:00
Rodrigo Girão Serrão
08baaf11f3 Refactor width reference. 2023-01-07 09:40:32 +00:00
Rodrigo Girão Serrão
2867b09923 Update visibility reference. 2023-01-06 16:38:49 +00:00
Rodrigo Girão Serrão
498f452b88 Update tint reference. 2023-01-06 14:53:18 +00:00
Rodrigo Girão Serrão
42baa0e074 Remove redundant values subsections.
[skip ci]
2023-01-06 14:41:13 +00:00
Rodrigo Girão Serrão
583b1273ac Update text style reference.
[skip ci]
2023-01-06 14:18:50 +00:00
Rodrigo Girão Serrão
a25ba1bea4 Update *opacity references. 2023-01-06 10:47:31 +00:00
Rodrigo Girão Serrão
042bc3b3fe Improve text-align example.
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.
2023-01-06 10:41:46 +00:00
Rodrigo Girão Serrão
7743feadff Add GIF to show all scrollbar colors. 2023-01-06 10:28:54 +00:00
Rodrigo Girão Serrão
c65c691b5a Rework text-align CSS reference.
[skip ci]
2023-01-05 18:35:21 +00:00
Rodrigo Girão Serrão
ffe1f4a0c4 Update scrollbar-size rule reference.
[skip ci]
2023-01-05 12:02:05 +00:00
Rodrigo Girão Serrão
73621b6867 Review reference for scrollbar-gutter. 2023-01-05 11:21:31 +00:00
Rodrigo Girão Serrão
c81a046c0c Fix and tweak scrollbar corner color reference. 2023-01-05 10:33:42 +00:00
Rodrigo Girão Serrão
3ebc78260b Update reference for all scrollbar colors. 2023-01-04 17:10:31 +00:00
Rodrigo Girão Serrão
d708c53e6c Fix links in link index. 2023-01-04 13:32:08 +00:00
Rodrigo Girão Serrão
745ec529b9 Update padding reference. 2023-01-04 11:43:47 +00:00
Rodrigo Girão Serrão
56e5e39740 Refactor overflow reference.
[skip ci]
2023-01-04 11:26:07 +00:00
Rodrigo Girão Serrão
01fcfe5459 Rework outline reference. 2023-01-04 10:34:50 +00:00
Rodrigo Girão Serrão
7047cc494f Update reference for opacity.
[skip ci]
2022-12-22 18:38:27 +00:00
Rodrigo Girão Serrão
8c0f1dc83c Fix links to CSS types. 2022-12-22 18:13:36 +00:00
Rodrigo Girão Serrão
9d8e4c53dc Update reference for offset. 2022-12-22 18:01:03 +00:00
Rodrigo Girão Serrão
296dd73565 Update reference for min/max width/height. 2022-12-22 17:46:08 +00:00
Rodrigo Girão Serrão
d5da65a44b Tweak template. 2022-12-22 17:45:42 +00:00
Rodrigo Girão Serrão
b3d80c432e Update reference for margin. 2022-12-22 15:43:11 +00:00
Rodrigo Girão Serrão
f807df73f9 Update links references. 2022-12-22 14:41:16 +00:00
Rodrigo Girão Serrão
a61405e792 Add direct links to sub rules. 2022-12-22 14:17:38 +00:00