new align

This commit is contained in:
Will McGugan
2022-09-27 16:35:40 +01:00
parent fc4ec8ee50
commit d962dcd49c
80 changed files with 336 additions and 687 deletions

File diff suppressed because one or more lines are too long

View File

@@ -14,10 +14,6 @@ def test_layers(snap_compare):
assert snap_compare("docs/examples/guide/layout/layers.py")
def test_center_layout(snap_compare):
assert snap_compare("docs/examples/guide/layout/center_layout.py")
def test_horizontal_layout(snap_compare):
assert snap_compare("docs/examples/guide/layout/horizontal_layout.py")

View File

@@ -1,28 +0,0 @@
from textual._layout import WidgetPlacement
from textual.geometry import Region, Size, Spacing
from textual.layouts.center import CenterLayout
from textual.widget import Widget
def test_center_layout():
widget = Widget()
widget._size = Size(80, 24)
child = Widget()
child.styles.width = 10
child.styles.height = 5
layout = CenterLayout()
placements, widgets = layout.arrange(widget, [child], Size(60, 20))
assert widgets == {child}
expected = [
WidgetPlacement(
region=Region(x=25, y=7, width=10, height=5),
margin=Spacing(),
widget=child,
order=0,
fixed=False,
),
]
assert placements == expected