Skip to content

Commit

Permalink
Merge pull request Textualize#1413 from Textualize/not-ugly
Browse files Browse the repository at this point in the history
Not ugly
  • Loading branch information
willmcgugan authored Dec 20, 2022
2 parents 59057ee + 9fda476 commit dd2b89b
Show file tree
Hide file tree
Showing 5 changed files with 264 additions and 265 deletions.
1 change: 1 addition & 0 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ def __init__(
self._screenshot: str | None = None
self._dom_lock = asyncio.Lock()
self._dom_ready = False
self.set_class(self.dark, "-dark-mode")

@property
def return_value(self) -> ReturnType | None:
Expand Down
6 changes: 1 addition & 5 deletions src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2179,11 +2179,7 @@ def refresh(
for ancestor in self.ancestors:
if not isinstance(ancestor, Widget):
break
if ancestor.styles.auto_dimensions:
for ancestor in self.ancestors_with_self:
if isinstance(ancestor, Widget):
ancestor._clear_arrangement_cache()
break
ancestor._clear_arrangement_cache()

if repaint:
self._set_dirty(*regions)
Expand Down
4 changes: 2 additions & 2 deletions src/textual/widgets/_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ class Header(Widget):
Header {
dock: top;
width: 100%;
background: $secondary-background;
background: $foreground 5%;
color: $text;
height: 1;
}
Header.-tall {
height: 3;
}
}
"""

tall = Reactive(False)
Expand Down
514 changes: 257 additions & 257 deletions tests/snapshot_tests/__snapshots__/test_snapshots.ambr

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion tests/test_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def on_key(self, event: events.Key) -> None:

app = TestApp()
async with app.run_test() as pilot:
assert str(pilot) == "<Pilot app=TestApp(title='TestApp')>"
assert (
str(pilot) == "<Pilot app=TestApp(title='TestApp', classes={'-dark-mode'})>"
)
await pilot.press("tab", *"foo")
await pilot.pause(1 / 100)
await pilot.exit("bar")
Expand Down

0 comments on commit dd2b89b

Please sign in to comment.