diff --git a/src/textual/_arrange.py b/src/textual/_arrange.py index c29b1c252..8c1032594 100644 --- a/src/textual/_arrange.py +++ b/src/textual/_arrange.py @@ -98,7 +98,7 @@ def arrange( ) dock_spacing = Spacing(top, right, bottom, left) - region = size.region.shrink(dock_spacing) + region = region.shrink(dock_spacing) layout_placements, arranged_layout_widgets = widget._layout.arrange( widget, layout_widgets, region.size ) diff --git a/src/textual/css/_style_properties.py b/src/textual/css/_style_properties.py index 4a45cfbbf..fc41a1a1b 100644 --- a/src/textual/css/_style_properties.py +++ b/src/textual/css/_style_properties.py @@ -511,45 +511,6 @@ class SpacingProperty: obj.refresh(layout=True) -class DocksProperty: - """Descriptor for getting and setting the docks property. This property - is used to define docks and their location on screen. - """ - - def __get__( - self, obj: StylesBase, objtype: type[StylesBase] | None = None - ) -> tuple[DockGroup, ...]: - """Get the Docks property - - Args: - obj (Styles): The ``Styles`` object. - objtype (type[Styles]): The ``Styles`` class. - - Returns: - tuple[DockGroup, ...]: A ``tuple`` containing the defined docks. - """ - if obj.has_rule("docks"): - return obj.get_rule("docks") - from .styles import DockGroup - - return (DockGroup("_default", "top", 1),) - - def __set__(self, obj: StylesBase, docks: Iterable[DockGroup] | None): - """Set the Docks property - - Args: - obj (Styles): The ``Styles`` object. - docks (Iterable[DockGroup]): Iterable of DockGroups - """ - _rich_traceback_omit = True - if docks is None: - if obj.clear_rule("docks"): - obj.refresh(layout=True) - else: - if obj.set_rule("docks", tuple(docks)): - obj.refresh(layout=True) - - class DockProperty: """Descriptor for getting and setting the dock property. The dock property allows you to specify which edge you want to fix a Widget to. diff --git a/src/textual/css/styles.py b/src/textual/css/styles.py index e257475be..4b2540cad 100644 --- a/src/textual/css/styles.py +++ b/src/textual/css/styles.py @@ -21,7 +21,6 @@ from ._style_properties import ( BoxProperty, ColorProperty, DockProperty, - DocksProperty, FractionalProperty, IntegerProperty, LayoutProperty, @@ -720,14 +719,6 @@ class Styles(StylesBase): append_declaration("offset", f"{x} {y}") if has_rule("dock"): append_declaration("dock", rules["dock"]) - if has_rule("docks"): - append_declaration( - "docks", - " ".join( - (f"{name}={edge}/{z}" if z else f"{name}={edge}") - for name, edge, z in rules["docks"] - ), - ) if has_rule("layers"): append_declaration("layers", " ".join(self.layers)) if has_rule("layer"):