Fixing more CSS, particularly around the widgets which involve toggling elements.

This commit is contained in:
Darren Burns
2024-11-14 11:39:04 +00:00
parent 260f28fd56
commit a2407f9377
5 changed files with 37 additions and 98 deletions

View File

@@ -363,8 +363,31 @@ class ChangingThemeApp(App[None]):
yield Header(show_clock=True, icon="🐟")
yield ThemeList(id="theme-list")
with VerticalScroll(id="widget-list") as container:
container.can_focus = False
with VerticalScroll(id="widget-list", can_focus=False) as container:
yield ToggleButton(label="Toggle Button")
yield SelectionList[int](
("Falken's Maze", 0, True),
("Black Jack", 1),
("Gin Rummy", 2),
("Hearts", 3),
("Bridge", 4),
("Checkers", 5),
("Chess", 6, True),
("Poker", 7),
("Fighter Combat", 8, True),
)
yield RadioSet(
"Amanda",
"Connor MacLeod",
"Duncan MacLeod",
"Heather MacLeod",
"Joe Dawson",
"Kurgan, [bold italic red]The[/]",
"Methos",
"Rachel Ellenstein",
"Ramírez",
)
yield Select(
[("foo", "foo"), ("bar", "bar"), ("baz", "baz"), ("qux", "qux")]
@@ -460,35 +483,11 @@ class ChangingThemeApp(App[None]):
)
yield Switch()
yield ToggleButton(label="Toggle Button")
yield SelectionList[int](
("Falken's Maze", 0, True),
("Black Jack", 1),
("Gin Rummy", 2),
("Hearts", 3),
("Bridge", 4),
("Checkers", 5),
("Chess", 6, True),
("Poker", 7),
("Fighter Combat", 8, True),
)
yield RadioSet(
"Amanda",
"Connor MacLeod",
"Duncan MacLeod",
"Heather MacLeod",
"Joe Dawson",
"Kurgan, [bold italic red]The[/]",
"Methos",
"Rachel Ellenstein",
"Ramírez",
)
yield Footer()
def on_mount(self) -> None:
self.theme = "textual-ansi"
self.theme = "textual-light"
text_area = self.query_one(TextArea)
text_area.selection = Selection((0, 0), (1, 10))