mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add dock example with four docks.
This commit is contained in:
34
docs/examples/styles/dock_all.css
Normal file
34
docs/examples/styles/dock_all.css
Normal 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;
|
||||
}
|
||||
17
docs/examples/styles/dock_all.py
Normal file
17
docs/examples/styles/dock_all.py
Normal 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")
|
||||
Reference in New Issue
Block a user