Add dock example with four docks.

This commit is contained in:
Rodrigo Girão Serrão
2022-12-15 18:59:57 +00:00
parent 4d810fcf0b
commit 9c10dcf80e
2 changed files with 51 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
#left {
dock: left;
height: 100%;
width: auto;
align-vertical: middle;
}
#top {
dock: top;
height: auto;
width: 100%;
align-horizontal: center;
}
#right {
dock: right;
height: 100%;
width: auto;
align-vertical: middle;
}
#bottom {
dock: bottom;
height: auto;
width: 100%;
align-horizontal: center;
}
Screen {
align: center middle;
}
#big_container {
width: 75%;
height: 75%;
border: round white;
}

View File

@@ -0,0 +1,17 @@
from textual.app import App
from textual.containers import Container
from textual.widgets import Label
class DockAllApp(App):
def compose(self):
yield Container(
Container(Label("left"), id="left"),
Container(Label("top"), id="top"),
Container(Label("right"), id="right"),
Container(Label("bottom"), id="bottom"),
id="big_container",
)
app = DockAllApp(css_path="dock_all.css")