Skip to content

Commit def653b

Browse files
committed
Merge branch 'main' into build-update-supported-python-versions
2 parents 156eb68 + f1c6bec commit def653b

36 files changed

+853
-126
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## Unreleased
99

10+
### Added
11+
12+
- Added scrollbar-visibility rule https://github.com/Textualize/textual/pull/6156
13+
14+
### Fixed
15+
16+
- Fixed highlight not auto-detecting lexer https://github.com/Textualize/textual/pull/6167
17+
18+
## [6.2.1] - 2025-10-01
19+
20+
- Fix inability to copy text outside of an input/textarea when it was focused https://github.com/Textualize/textual/pull/6148
21+
- Fix issue when copying text after a double click https://github.com/Textualize/textual/pull/6148
22+
23+
## [6.2.0] - 2025-09-30
24+
1025
### Changed
1126

1227
- Eager tasks are now enabled On Python3.12 and above https://github.com/Textualize/textual/pull/6102
@@ -26,6 +41,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2641
- Added `compact` to Binding.Group https://github.com/Textualize/textual/pull/6132
2742
- Added `Screen.get_hover_widgets_at` https://github.com/Textualize/textual/pull/6132
2843
- Added `Content.wrap` https://github.com/Textualize/textual/pull/6138
44+
- Added support to allow support for manual keys in add_columns as well. https://github.com/Textualize/textual/pull/5923
2945

3046
### Fixed
3147

@@ -3128,6 +3144,8 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
31283144
- New handler system for messages that doesn't require inheritance
31293145
- Improved traceback handling
31303146

3147+
[6.2.1]: https://github.com/Textualize/textual/compare/v6.2.0...v6.2.1
3148+
[6.2.0]: https://github.com/Textualize/textual/compare/v6.1.0...v6.2.0
31313149
[6.1.0]: https://github.com/Textualize/textual/compare/v6.0.0...v6.1.0
31323150
[6.0.0]: https://github.com/Textualize/textual/compare/v5.3.0...v6.0.0
31333151
[5.3.0]: https://github.com/Textualize/textual/compare/v5.2.0...v5.3.0
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from textual.app import App
2+
from textual.containers import Horizontal, VerticalScroll
3+
from textual.widgets import Label
4+
5+
TEXT = """I must not fear.
6+
Fear is the mind-killer.
7+
Fear is the little-death that brings total obliteration.
8+
I will face my fear.
9+
I will permit it to pass over me and through me.
10+
And when it has gone past, I will turn the inner eye to see its path.
11+
Where the fear has gone there will be nothing. Only I will remain.
12+
"""
13+
14+
15+
class ScrollbarApp(App):
16+
CSS_PATH = "scrollbar_visibility.tcss"
17+
18+
def compose(self):
19+
yield Horizontal(
20+
VerticalScroll(Label(TEXT * 10), classes="left"),
21+
VerticalScroll(Label(TEXT * 10), classes="right"),
22+
)
23+
24+
25+
if __name__ == "__main__":
26+
app = ScrollbarApp()
27+
app.run()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
VerticalScroll {
2+
width: 1fr;
3+
}
4+
5+
.left {
6+
scrollbar-visibility: visible; # The default
7+
}
8+
9+
.right {
10+
scrollbar-visibility: hidden;
11+
}

docs/styles/align.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Align
22

3-
The `align` style aligns children within a container.
3+
The `align` style defines how a widget's *children* are aligned.
4+
5+
Apply this rule to a container to adjust where its children are positioned.
46

57
## Syntax
68

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Scrollbar-visibility
2+
3+
The `scrollbar-visibility` is used to show or hide scrollbars.
4+
5+
If scrollbars are hidden, the user may still scroll the container using the mouse wheel / keys / and gestures, but
6+
there will be no scrollbars shown.
7+
8+
## Syntax
9+
10+
--8<-- "docs/snippets/syntax_block_start.md"
11+
scrollbar-visibility: hidden | visible;
12+
--8<-- "docs/snippets/syntax_block_end.md"
13+
14+
15+
### Values
16+
17+
| Value | Description |
18+
| ------------------- | ---------------------------------------------------- |
19+
| `hidden` | The widget's scrollbars will be hidden. |
20+
| `visible` (default) | The widget's scrollbars will be displayed as normal. |
21+
22+
23+
## Examples
24+
25+
The following example contains two containers with the same text.
26+
The container on the right has its scrollbar hidden.
27+
28+
=== "Output"
29+
30+
```{.textual path="docs/examples/styles/scrollbar_visibility.py"}
31+
```
32+
33+
=== "scrollbar_visibility.py"
34+
35+
```py
36+
--8<-- "docs/examples/styles/scrollbar_visibility.py"
37+
```
38+
39+
=== "scrollbar_visibility.tcss"
40+
41+
```css
42+
--8<-- "docs/examples/styles/scrollbar_visibility.tcss"
43+
```
44+
45+
46+
## CSS
47+
48+
```css
49+
scrollbar-visibility: visible;
50+
scrollbar-visibility: hidden;
51+
```
52+
53+
54+
55+
## Python
56+
57+
```py
58+
widget.styles.scrollbar_visibility = "visible";
59+
widget.styles.scrollbar_visibility = "hidden";
60+
```

mkdocs-nav.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ nav:
136136
- "styles/scrollbar_colors/scrollbar_corner_color.md"
137137
- "styles/scrollbar_gutter.md"
138138
- "styles/scrollbar_size.md"
139+
- "styles/scrollbar_visibility.md"
139140
- "styles/text_align.md"
140141
- "styles/text_opacity.md"
141142
- "styles/text_overflow.md"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "textual"
3-
version = "6.1.0"
3+
version = "6.2.1"
44
homepage = "https://github.com/Textualize/textual"
55
repository = "https://github.com/Textualize/textual"
66
documentation = "https://textual.textualize.io/"

src/textual/_arrange.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def arrange(
5353
Returns:
5454
Widget arrangement information.
5555
"""
56-
5756
placements: list[WidgetPlacement] = []
5857
scroll_spacing = NULL_SPACING
5958
styles = widget.styles

src/textual/_compositor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def add_widget(
694694
if (
695695
widget.show_vertical_scrollbar
696696
or widget.show_horizontal_scrollbar
697-
):
697+
) and styles.scrollbar_visibility == "visible":
698698
for chrome_widget, chrome_region in widget._arrange_scrollbars(
699699
container_region
700700
):
@@ -1248,8 +1248,7 @@ def update_widgets(self, widgets: set[Widget]) -> None:
12481248
offset = region.offset
12491249
intersection = clip.intersection
12501250
for dirty_region in widget._exchange_repaint_regions():
1251-
update_region = intersection(dirty_region.translate(offset))
1252-
if update_region:
1251+
if update_region := intersection(dirty_region.translate(offset)):
12531252
add_region(update_region)
12541253

12551254
self._dirty_regions.update(regions)

src/textual/_styles_cache.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ def render_widget(self, widget: Widget, crop: Region) -> list[Strip]:
104104
Returns:
105105
Rendered lines.
106106
"""
107-
108107
border_title = widget._border_title
109108
border_subtitle = widget._border_subtitle
110109

0 commit comments

Comments
 (0)