This commit is contained in:
Will McGugan
2022-09-09 17:52:08 +01:00
parent 8666e84e64
commit 73fa5010ad
5 changed files with 7 additions and 179 deletions

View File

@@ -2,6 +2,7 @@
# Textual # Textual
Textual is a Python framework for creating applications within your terminal.
Textual is a Python framework for creating applications within your terminal—powered by [Rich](https://github.com/Textualize/rich). Textual is a Python framework for creating applications within your terminal—powered by [Rich](https://github.com/Textualize/rich).

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -9,16 +9,15 @@ CodeBrowser.-show-tree #tree-view {
dock: left; dock: left;
height: 100%; height: 100%;
max-width: 50%; max-width: 50%;
background: $surface; background: $panel;
} }
CodeBrowser{ CodeBrowser{
background: $surface-darken-1; background: $background;
} }
DirectoryTree { DirectoryTree {
padding-right: 1; padding-right: 1;
} }
#code { #code {

View File

@@ -5,7 +5,7 @@ from rich.traceback import Traceback
from textual.app import App, ComposeResult from textual.app import App, ComposeResult
from textual.layout import Container, Vertical from textual.layout import Container, Vertical
from textual.reactive import Reactive from textual.reactive import var
from textual.widgets import DirectoryTree, Footer, Header, Static from textual.widgets import DirectoryTree, Footer, Header, Static
@@ -17,7 +17,7 @@ class CodeBrowser(App):
("q", "quit", "Quit"), ("q", "quit", "Quit"),
] ]
show_tree = Reactive.init(True) show_tree = var(True)
def watch_show_tree(self, show_tree: bool) -> None: def watch_show_tree(self, show_tree: bool) -> None:
"""Called when show_tree is modified.""" """Called when show_tree is modified."""

View File

@@ -164,8 +164,8 @@ class TreeNode(Generic[NodeDataType]):
class TreeControl(Generic[NodeDataType], Static, can_focus=True): class TreeControl(Generic[NodeDataType], Static, can_focus=True):
DEFAULT_CSS = """ DEFAULT_CSS = """
TreeControl { TreeControl {
background: $surface; background: $panel;
color: $text-surface; color: $text-panel;
height: auto; height: auto;
width: 100%; width: 100%;
} }