mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
snapshot
This commit is contained in:
41
tests/snapshot_tests/snapshot_apps/offsets.py
Normal file
41
tests/snapshot_tests/snapshot_apps/offsets.py
Normal 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()
|
||||
Reference in New Issue
Block a user