Update visibility example to use labels.

This commit is contained in:
Rodrigo Girão Serrão
2023-01-06 16:37:41 +00:00
parent 498f452b88
commit d69168a922
2 changed files with 11 additions and 10 deletions

View File

@@ -1,12 +1,13 @@
Screen { Screen {
background: green; background: green;
} }
Static { Label {
height: 5; height: 5;
background: white; width: 100%;
color: blue; background: white;
border: heavy blue; color: blue;
border: heavy blue;
} }
Static.invisible { Label.invisible {
visibility: hidden; visibility: hidden;
} }

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 VisibilityApp(App): class VisibilityApp(App):
def compose(self): def compose(self):
yield Static("Widget 1") yield Label("Widget 1")
yield Static("Widget 2", classes="invisible") yield Label("Widget 2", classes="invisible")
yield Static("Widget 3") yield Label("Widget 3")
app = VisibilityApp(css_path="visibility.css") app = VisibilityApp(css_path="visibility.css")