Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed `RichLog.write` not respecting `width` parameter https://github.com/Textualize/textual/pull/4978
- Fixed `RichLog` writing at wrong width when `write` occurs before width is known (e.g. in `compose` or `on_mount`) https://github.com/Textualize/textual/pull/4978
- Fixed `RichLog.write` incorrectly shrinking width to `RichLog.min_width` when `shrink=True` (now shrinks to fit content area instead) https://github.com/Textualize/textual/pull/4978
- Fixed flicker when setting `dark` reactive on startup https://github.com/Textualize/textual/pull/4989

## [0.79.1] - 2024-08-31

Expand Down
11 changes: 7 additions & 4 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,17 +1084,17 @@ def watch_dark(self, dark: bool) -> None:
self.set_class(dark, "-dark-mode", update=False)
self.set_class(not dark, "-light-mode", update=False)
self._refresh_truecolor_filter(self.ansi_theme)
self.call_later(self.refresh_css)
self.call_next(self.refresh_css)

def watch_ansi_theme_dark(self, theme: TerminalTheme) -> None:
if self.dark:
self._refresh_truecolor_filter(theme)
self.call_later(self.refresh_css)
self.call_next(self.refresh_css)

def watch_ansi_theme_light(self, theme: TerminalTheme) -> None:
if not self.dark:
self._refresh_truecolor_filter(theme)
self.call_later(self.refresh_css)
self.call_next(self.refresh_css)

@property
def ansi_theme(self) -> TerminalTheme:
Expand Down Expand Up @@ -3130,7 +3130,10 @@ def refresh_css(self, animate: bool = True) -> None:
stylesheet.set_variables(self.get_css_variables())
stylesheet.reparse()
stylesheet.update(self.app, animate=animate)
self.screen._refresh_layout(self.size)
try:
self.screen._refresh_layout(self.size)
except ScreenError:
pass
# The other screens in the stack will need to know about some style
# changes, as a final pass let's check in on every screen that isn't
# the current one and update them too.
Expand Down
Loading