mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Update visibility example to use labels.
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
Screen {
|
Screen {
|
||||||
background: green;
|
background: green;
|
||||||
}
|
}
|
||||||
Static {
|
Label {
|
||||||
height: 5;
|
height: 5;
|
||||||
|
width: 100%;
|
||||||
background: white;
|
background: white;
|
||||||
color: blue;
|
color: blue;
|
||||||
border: heavy blue;
|
border: heavy blue;
|
||||||
}
|
}
|
||||||
Static.invisible {
|
Label.invisible {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user