mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
new align
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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")
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user