Commit Graph

101 Commits

Author SHA1 Message Date
Rodrigo Girão Serrão
6523fbaff1 Fix tests. 2023-05-18 16:27:09 +01:00
Will McGugan
f53c3cd589 container refactor (#2377)
* container refactor

* Rearrange css

* changelog

* try timer updates

* force update

* sleep idle

* Restore updates
2023-04-26 13:36:08 +01:00
Dave Pearson
b896e9d7f9 Update tests to handle scroll changes to Container
See #2361.
2023-04-24 11:10:37 +01:00
Will McGugan
0509cf8948 Border style (#2292)
* border styles

* docs for border styles

* fix tests

* tests

* tests and docs

* changelog

* implement auto

* style information fix
2023-04-16 12:31:39 +01:00
Rodrigo Girão Serrão
9fa7de13dc Update docs with new border type.
Related PRs: #2139.
Related comments: https://github.com/Textualize/textual/pull/2139\#discussion_r1149249378
2023-03-27 16:55:26 +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
Rodrigo Girão Serrão
cc8f65259e Merge branch 'main' into add-containers 2023-03-13 12:00:08 +00:00
Will McGugan
9c5e0336f8 Fix scrollbar (#2024)
* Fix scrollbar

* changelog PR

* fix snapshots
2023-03-13 10:39:14 +00:00
Rodrigo Girão Serrão
8565d3cef6 Renamed 'Vertical' to 'VerticalScroll'.
Related issues: #1957.
2023-03-08 18:31:24 +00:00
Will McGugan
11d10db1ab fast path for scrolling 2023-02-17 10:42:42 +00:00
Rodrigo Girão Serrão
d41471034a Fix failing tests. 2023-01-09 16:39:12 +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
15691b4451 Remove debugging style. 2023-01-09 16:34:06 +00:00
Rodrigo Girão Serrão
a1b9d4b2c5 Fix examples. 2023-01-09 16:11:45 +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
71b859b6e2 Add thorough example for all outlines. 2023-01-09 13:49:32 +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
8de6d8fd69 Add new width comparison example. 2023-01-07 09:40:03 +00:00
Rodrigo Girão Serrão
2217a8f5fa Add new visibility example.
This new example shows how we can have an invisible container with visible children.
2023-01-06 16:38:31 +00:00
Rodrigo Girão Serrão
d69168a922 Update visibility example to use labels. 2023-01-06 16:37:41 +00:00
Rodrigo Girão Serrão
ee4b2cfe9e Update tint example to use labels. 2023-01-06 14:53:07 +00:00
Rodrigo Girão Serrão
72d3171a79 Add example with all text styles. 2023-01-06 14:18:21 +00:00
Rodrigo Girão Serrão
1276629431 Update example. 2023-01-06 14:18:07 +00:00
Rodrigo Girão Serrão
c7c352a38a Replace statics with labels.
[skip ci]
2023-01-06 10:56:55 +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
f457afd826 Add example for all scrollbar size rules. 2023-01-05 12:01:41 +00:00
Rodrigo Girão Serrão
5b6bedd8c6 Fix example to use labels. 2023-01-05 12:01:23 +00:00
Rodrigo Girão Serrão
9b53c7a704 Update base scrollbar example. 2023-01-04 17:10:12 +00:00
Rodrigo Girão Serrão
14f0240d6a Add example for (background) scrollbar active/hover. 2023-01-04 17:09:58 +00:00
Rodrigo Girão Serrão
7fb00f531c Add example for corner colors. 2023-01-04 17:09:35 +00:00
Rodrigo Girão Serrão
454d36cdc7 Use labels instead of static. 2023-01-04 11:43:38 +00:00
Rodrigo Girão Serrão
52497172b0 Add example to compare border and outline. 2023-01-04 10:34:37 +00:00
Rodrigo Girão Serrão
0fe5a98033 Use labels instead of statics. 2023-01-04 10:34:22 +00:00
Rodrigo Girão Serrão
bebd054e5e Update opacity example. 2022-12-22 18:38:14 +00:00
Rodrigo Girão Serrão
289ec2556b Tweak example for offset. 2022-12-22 18:00:52 +00:00
Rodrigo Girão Serrão
d0c744d8d9 Add examples for min/max width/height. 2022-12-22 17:45:55 +00:00
Rodrigo Girão Serrão
164678ab66 Fix reference for layout. 2022-12-22 14:05:17 +00:00
Rodrigo Girão Serrão
e789c9c006 Use labels instead of statics. 2022-12-21 16:49:27 +00:00
Rodrigo Girão Serrão
a617d4091c Add example with all margin rules. 2022-12-21 16:48:43 +00:00
Rodrigo Girão Serrão
57af822730 Add example for link hover style. 2022-12-20 18:47:22 +00:00
Rodrigo Girão Serrão
8ce8b4c33a Add example for link hover background. 2022-12-20 18:47:15 +00:00
Rodrigo Girão Serrão
e68e02405f Add example for link hover color. 2022-12-20 18:47:05 +00:00
Rodrigo Girão Serrão
47ef2aa73f Add example for link style. 2022-12-20 18:46:44 +00:00
Rodrigo Girão Serrão
8138961f60 Add example for link background. 2022-12-20 18:46:33 +00:00
Rodrigo Girão Serrão
4aad7cda89 Add example for link color. 2022-12-20 17:29:57 +00:00
Rodrigo Girão Serrão
591e343a5a Add example to compare all heights. 2022-12-20 10:40:13 +00:00
Rodrigo Girão Serrão
0ccc2bbc00 Add example for column-span. 2022-12-19 18:44:48 +00:00
Rodrigo Girão Serrão
5ff0f79720 Add example for row-span. 2022-12-19 18:42:45 +00:00
Rodrigo Girão Serrão
50ee4e57f2 Add example for grid-gutter. 2022-12-19 18:42:28 +00:00
Rodrigo Girão Serrão
5e901458fb Add grid size examples. 2022-12-19 18:01:29 +00:00