Skip to content

Commit a6b1710

Browse files
committed
auto height logic
1 parent 4ec7d38 commit a6b1710

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/textual/_arrange.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,18 @@ 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
103+
# if styles.is_auto_height:
104+
# container_height = 0
105+
# if styles.is_auto_width:
106+
# container_width = 0
107+
102108
placement_offset += styles._align_size(
103-
bounding_region.size, dock_region.size
109+
bounding_region.size,
110+
Size(
111+
0 if styles.is_auto_width else container_width,
112+
0 if styles.is_auto_height else container_height,
113+
),
104114
).clamped
105115

106116
if placement_offset:

0 commit comments

Comments
 (0)