mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Revert dev sandbox
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user