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 {
background: green;
}
Static {
height: 5;
background: white;
color: blue;
border: heavy blue;
Label {
height: 5;
width: 100%;
background: white;
color: blue;
border: heavy blue;
}
Static.invisible {
Label.invisible {
visibility: hidden;
}

View File

@@ -1,12 +1,12 @@
from textual.app import App
from textual.widgets import Static
from textual.widgets import Label
class VisibilityApp(App):
def compose(self):
yield Static("Widget 1")
yield Static("Widget 2", classes="invisible")
yield Static("Widget 3")
yield Label("Widget 1")
yield Label("Widget 2", classes="invisible")
yield Label("Widget 3")
app = VisibilityApp(css_path="visibility.css")