Revert dev sandbox

This commit is contained in:
Darren Burns
2022-01-26 11:24:03 +00:00
parent 328b1be0b1
commit d1738cffb5
2 changed files with 11 additions and 21 deletions

View File

@@ -1,8 +1,8 @@
/* CSS file for dev_sandbox.py */ /* CSS file for basic.py */
App > View { App > View {
layout: vertical; docks: side=left/1;
text: on #6e06c2; text: on #20639b;
} }
Widget:hover { Widget:hover {
@@ -36,11 +36,6 @@ Widget:hover {
#content { #content {
text: white on #20639b; text: white on #20639b;
border-bottom: hkey #0f2b41; border-bottom: hkey #0f2b41;
offset-y: -3;
}
#content.-content-visible {
visibility: hidden;
} }
#footer { #footer {

View File

@@ -1,28 +1,23 @@
from rich.console import RenderableType
from rich.panel import Panel
from textual.app import App from textual.app import App
from textual.widget import Widget from textual.widget import Widget
class PanelWidget(Widget):
def render(self) -> RenderableType:
return Panel("hello world!", title="Title", height=4)
class BasicApp(App): class BasicApp(App):
"""Sandbox application used for testing/development by Textual developers""" """A basic app demonstrating CSS"""
def on_load(self): def on_load(self):
"""Bind keys here.""" """Bind keys here."""
self.bind("tab", "toggle_class('#sidebar', '-active')") self.bind("tab", "toggle_class('#sidebar', '-active')")
self.bind("a", "toggle_class('#header', '-visible')") self.bind("a", "toggle_class('#header', '-visible')")
self.bind("c", "toggle_class('#content', '-content-visible')")
def on_mount(self): def on_mount(self):
"""Build layout here.""" """Build layout here."""
self.mount(header=PanelWidget(), content=PanelWidget(), footer=PanelWidget()) self.mount(
self.view.refresh_layout() header=Widget(),
content=Widget(),
footer=Widget(),
sidebar=Widget(),
)
BasicApp.run(log="textual.log") BasicApp.run(css_file="dev_sandbox.css", watch_css=True, log="textual.log")