From 73fa5010adea7a52404a0c487d420c90492850b7 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Fri, 9 Sep 2022 17:52:08 +0100 Subject: [PATCH] tweaks --- README.md | 1 + ...lculatorapp_2022-09-09T15:58:33.436117.svg | 172 ------------------ examples/code_browser.css | 5 +- examples/code_browser.py | 4 +- src/textual/widgets/_tree_control.py | 4 +- 5 files changed, 7 insertions(+), 179 deletions(-) delete mode 100644 examples/calculatorapp_2022-09-09T15:58:33.436117.svg diff --git a/README.md b/README.md index 637674c37..b066089ad 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ # 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). diff --git a/examples/calculatorapp_2022-09-09T15:58:33.436117.svg b/examples/calculatorapp_2022-09-09T15:58:33.436117.svg deleted file mode 100644 index b8ab97484..000000000 --- a/examples/calculatorapp_2022-09-09T15:58:33.436117.svg +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CalculatorApp - - - - - - - - - - - - -0 - - - -▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - AC  +/-  %  ÷  -▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - -▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - 7  8  9  ×  -▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - -▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - 4  5  6  -  -▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - -▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - 1  2  3  +  -▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - -▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - 0  .  =  -▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - - - - diff --git a/examples/code_browser.css b/examples/code_browser.css index 00f62979d..c900de69c 100644 --- a/examples/code_browser.css +++ b/examples/code_browser.css @@ -9,16 +9,15 @@ CodeBrowser.-show-tree #tree-view { dock: left; height: 100%; max-width: 50%; - background: $surface; + background: $panel; } CodeBrowser{ - background: $surface-darken-1; + background: $background; } DirectoryTree { padding-right: 1; - } #code { diff --git a/examples/code_browser.py b/examples/code_browser.py index d156a7c10..f2ea041bc 100644 --- a/examples/code_browser.py +++ b/examples/code_browser.py @@ -5,7 +5,7 @@ from rich.traceback import Traceback from textual.app import App, ComposeResult from textual.layout import Container, Vertical -from textual.reactive import Reactive +from textual.reactive import var from textual.widgets import DirectoryTree, Footer, Header, Static @@ -17,7 +17,7 @@ class CodeBrowser(App): ("q", "quit", "Quit"), ] - show_tree = Reactive.init(True) + show_tree = var(True) def watch_show_tree(self, show_tree: bool) -> None: """Called when show_tree is modified.""" diff --git a/src/textual/widgets/_tree_control.py b/src/textual/widgets/_tree_control.py index c2b163d28..549bdac8c 100644 --- a/src/textual/widgets/_tree_control.py +++ b/src/textual/widgets/_tree_control.py @@ -164,8 +164,8 @@ class TreeNode(Generic[NodeDataType]): class TreeControl(Generic[NodeDataType], Static, can_focus=True): DEFAULT_CSS = """ TreeControl { - background: $surface; - color: $text-surface; + background: $panel; + color: $text-panel; height: auto; width: 100%; }