textual.layout
DockArrangeResult
dataclass
¶
Result of Layout.arrange.
Layout
¶
Bases: ABC
Base class of the object responsible for arranging Widgets within a container.
WidgetPlacement
¶
Bases: NamedTuple
The position, size, and relative order of a widget within its parent.
get_bounds
classmethod
¶
get_bounds(placements)
Get a bounding region around all placements.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Iterable[WidgetPlacement]
|
A number of placements. |
required |
Returns:
Type | Description |
---|---|
Region
|
An optimal binding box around all placements. |
translate
classmethod
¶
translate(placements, translate_offset)
Move all placements by a given offset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
list[WidgetPlacement]
|
List of placements. |
required |
|
Offset to add to placements. |
required |
Returns:
Type | Description |
---|---|
list[WidgetPlacement]
|
Placements with adjusted region, or same instance if offset is null. |