Change statics to labels.

This commit is contained in:
Rodrigo Girão Serrão
2022-12-15 18:10:02 +00:00
parent 03a2e3080a
commit ddd2e25038
2 changed files with 8 additions and 6 deletions

View File

@@ -4,7 +4,8 @@
} }
#box2 { #box2 {
content-align: center middle; content-align-horizontal: center;
content-align-vertical: middle;
background: green; background: green;
} }
@@ -13,7 +14,8 @@
background: blue; background: blue;
} }
Static { Label {
width: 100%;
height: 1fr; height: 1fr;
padding: 1; padding: 1;
color: white; color: white;

View File

@@ -1,12 +1,12 @@
from textual.app import App from textual.app import App
from textual.widgets import Static from textual.widgets import Label
class ContentAlignApp(App): class ContentAlignApp(App):
def compose(self): def compose(self):
yield Static("With [i]content-align[/] you can...", id="box1") yield Label("With [i]content-align[/] you can...", id="box1")
yield Static("...[b]Easily align content[/]...", id="box2") yield Label("...[b]Easily align content[/]...", id="box2")
yield Static("...Horizontally [i]and[/] vertically!", id="box3") yield Label("...Horizontally [i]and[/] vertically!", id="box3")
app = ContentAlignApp(css_path="content_align.css") app = ContentAlignApp(css_path="content_align.css")