mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Remove unused docks code
This commit is contained in:
@@ -98,7 +98,7 @@ def arrange(
|
|||||||
)
|
)
|
||||||
|
|
||||||
dock_spacing = Spacing(top, right, bottom, left)
|
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(
|
layout_placements, arranged_layout_widgets = widget._layout.arrange(
|
||||||
widget, layout_widgets, region.size
|
widget, layout_widgets, region.size
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -511,45 +511,6 @@ class SpacingProperty:
|
|||||||
obj.refresh(layout=True)
|
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:
|
class DockProperty:
|
||||||
"""Descriptor for getting and setting the dock property. The dock property
|
"""Descriptor for getting and setting the dock property. The dock property
|
||||||
allows you to specify which edge you want to fix a Widget to.
|
allows you to specify which edge you want to fix a Widget to.
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ from ._style_properties import (
|
|||||||
BoxProperty,
|
BoxProperty,
|
||||||
ColorProperty,
|
ColorProperty,
|
||||||
DockProperty,
|
DockProperty,
|
||||||
DocksProperty,
|
|
||||||
FractionalProperty,
|
FractionalProperty,
|
||||||
IntegerProperty,
|
IntegerProperty,
|
||||||
LayoutProperty,
|
LayoutProperty,
|
||||||
@@ -720,14 +719,6 @@ class Styles(StylesBase):
|
|||||||
append_declaration("offset", f"{x} {y}")
|
append_declaration("offset", f"{x} {y}")
|
||||||
if has_rule("dock"):
|
if has_rule("dock"):
|
||||||
append_declaration("dock", rules["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"):
|
if has_rule("layers"):
|
||||||
append_declaration("layers", " ".join(self.layers))
|
append_declaration("layers", " ".join(self.layers))
|
||||||
if has_rule("layer"):
|
if has_rule("layer"):
|
||||||
|
|||||||
Reference in New Issue
Block a user