This commit is contained in:
Will McGugan
2022-12-08 16:51:31 +00:00
parent 3c425c330e
commit 1f64127235
6 changed files with 209 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,41 @@
from textual.app import App, ComposeResult
from textual.containers import Vertical
from textual.widgets import Label, Static
class Box(Static):
DEFAULT_CSS = """
Box {
border: solid white;
background: darkblue;
width: 16;
height: auto;
}
"""
def compose(self) -> ComposeResult:
yield Label("FOO\nBAR\nBAZ")
class OffsetsApp(App):
CSS = """
#box1 {
offset: 5 5;
}
#box2 {
offset: 15 10;
}
"""
def compose(self) -> ComposeResult:
yield Box(id="box1")
yield Box(id="box2")
if __name__ == "__main__":
app = OffsetsApp()
app.run()

View File

@@ -151,6 +151,11 @@ def test_columns_height(snap_compare):
assert snap_compare("snapshot_apps/columns_height.py")
def test_offsets(snap_compare):
"""Test offsets of containers"""
assert snap_compare("snapshot_apps/offsets.py")
# --- Other ---