Remove unused docks code

This commit is contained in:
Darren Burns
2022-09-22 14:59:32 +01:00
parent 3038652d75
commit b3cf65c45f
3 changed files with 1 additions and 49 deletions

View File

@@ -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
)

View File

@@ -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.

View File

@@ -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"):