Skip to content

Commit c619f3c

Browse files
authored
Merge pull request #5552 from Textualize/auto-height-redux
auto height logic
2 parents 4ec7d38 + c5a3f76 commit c619f3c

File tree

7 files changed

+347
-92
lines changed

7 files changed

+347
-92
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Fixed
1111

1212
- Fixed smooth scrolling broken on iTerm over SSH https://github.com/Textualize/textual/pull/5551
13+
- Fixed height of auto container which contains auto height children https://github.com/Textualize/textual/pull/5552
1314

1415
## [2.0.4] - 2025-02-17
1516

poetry.lock

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ tree-sitter-rust = { version = ">=0.23.0", optional = true, python = ">=3.9" }
6767
tree-sitter-go = { version = ">=0.23.0", optional = true, python = ">=3.9" }
6868
tree-sitter-regex = { version = ">=0.24.0", optional = true, python = ">=3.9" }
6969
tree-sitter-xml = { version = ">=0.7.0", optional = true, python = ">=3.9" }
70-
tree-sitter-sql = { version = ">=0.3.0", optional = true, python = ">=3.9" }
70+
tree-sitter-sql = { version = ">=0.3.0,<0.3.8", optional = true, python = ">=3.9" }
7171
tree-sitter-java = { version = ">=0.23.0", optional = true, python = ">=3.9" }
7272
tree-sitter-bash = { version = ">=0.23.0", optional = true, python = ">=3.9" }
7373
# end of [syntax] extras

src/textual/_arrange.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,13 @@ def arrange(
9999
# Perform any alignment of the widgets.
100100
if styles.align_horizontal != "left" or styles.align_vertical != "top":
101101
bounding_region = WidgetPlacement.get_bounds(layout_placements)
102+
container_width, container_height = dock_region.size
102103
placement_offset += styles._align_size(
103-
bounding_region.size, dock_region.size
104+
bounding_region.size,
105+
Size(
106+
0 if styles.is_auto_width else container_width,
107+
0 if styles.is_auto_height else container_height,
108+
),
104109
).clamped
105110

106111
if placement_offset:

0 commit comments

Comments
 (0)