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 {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user