Files
textual/tests/snapshot_tests/snapshot_apps/fr_units.py
Rodrigo Girão Serrão 8565d3cef6 Renamed 'Vertical' to 'VerticalScroll'.
Related issues: #1957.
2023-03-08 18:31:24 +00:00

55 lines
964 B
Python

from textual.app import App, ComposeResult
from textual.containers import Horizontal, VerticalScroll
from textual.widgets import Static
class StaticText(Static):
pass
class FRApp(App):
CSS = """
StaticText {
height: 1fr;
background: $boost;
border: heavy white;
}
#foo {
width: 10;
}
#bar {
width: 1fr;
}
#baz {
width: 8;
}
#header {
height: 1fr
}
Horizontal {
height: 2fr;
}
#footer {
height: 4;
}
"""
def compose(self) -> ComposeResult:
yield VerticalScroll(
StaticText("HEADER", id="header"),
Horizontal(
StaticText("foo", id="foo"),
StaticText("bar", id="bar"),
StaticText("baz", id="baz"),
),
StaticText("FOOTER", id="footer"),
)
if __name__ == "__main__":
app = FRApp()
app.run()