Skip to content

Commit f4a7329

Browse files
authored
Merge pull request #11 from Textualize/fix-colors
fix for colors view
2 parents c4c2276 + b07e4cd commit f4a7329

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "textual-dev"
3-
version = "1.1.0"
3+
version = "1.2.0"
44
homepage = "https://github.com/Textualize/textual-dev"
55
description = "Development tools for working with Textual"
66
authors = ["Will McGugan <will@textualize.io>", "Dave Pearson <dave@textualize.io>"]
@@ -28,7 +28,7 @@ include = [
2828

2929
[tool.poetry.dependencies]
3030
python = "^3.7"
31-
textual = ">=0.32.0"
31+
textual = ">=0.33.0"
3232
aiohttp = ">=3.8.1"
3333
click = ">=8.1.2"
3434
msgpack = ">=1.0.3"

src/textual_dev/previews/colors.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ColorsView {
1818
align: center middle;
1919
overflow-x: auto;
2020
background: $background;
21-
scrollbar-gutter: stable;
21+
scrollbar-gutter: stable;
2222
}
2323

2424
ColorItem {
@@ -57,6 +57,10 @@ ColorGroup.-active {
5757
border: wide $secondary;
5858
}
5959

60+
NamedColorsView {
61+
height: 1fr;
62+
}
63+
6064
.text {
6165
color: $text;
6266
}

src/textual_dev/previews/colors.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ColorsView(VerticalScroll):
3232
pass
3333

3434

35-
class ColorTabs(TabbedContent, inherit_css=False):
35+
class ColorTabs(TabbedContent):
3636
pass
3737

3838

@@ -79,15 +79,15 @@ class ColorsApp(App[None]):
7979
def compose(self) -> ComposeResult:
8080
yield Footer()
8181
with ColorTabs("Theme Colors", "Named Colors"):
82-
yield Content(ThemeColorButtons())
83-
yield Vertical(NamedColorsView())
82+
yield Content(ThemeColorButtons(), id="theme")
83+
yield NamedColorsView()
8484

8585
def on_mount(self) -> None:
8686
self.call_after_refresh(self.update_view)
8787

88-
def update_view(self) -> None:
89-
content = self.query_one("Content", Content)
90-
content.mount(ThemeColorsView())
88+
async def update_view(self) -> None:
89+
content = self.query_one("#theme", Content)
90+
await content.mount(ThemeColorsView())
9191

9292
def on_button_pressed(self, event: Button.Pressed) -> None:
9393
self.query(ColorGroup).remove_class("-active")

0 commit comments

Comments
 (0)