fix bug with layout updates

This commit is contained in:
Will McGugan
2022-08-07 21:16:59 +01:00
parent c4ac2cce95
commit f9828fba71
5 changed files with 13 additions and 4 deletions

View File

@@ -27,6 +27,10 @@ class CenterApp(App):
margin: 2 4;
}
#sidebar.hidden {
width: 0;
}
Static {
background: $panel;
color: $text-panel;
@@ -35,6 +39,9 @@ class CenterApp(App):
"""
def on_mount(self) -> None:
self.bind("t", "toggle_class('#sidebar', 'hidden')")
def compose(self):
yield Static("Sidebar", id="sidebar")
yield Vertical(
@@ -45,4 +52,4 @@ class CenterApp(App):
)
app = CenterApp()
app = CenterApp(log_verbosity=3)