Skip to content

Commit

Permalink
Merge pull request #2339 from davep/refresh-all-the-screens
Browse files Browse the repository at this point in the history
Ensure an app's CSS refresh updates all screens in the stack
  • Loading branch information
davep authored Apr 20, 2023
2 parents f4e5f23 + 61dc08d commit 60542c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Fixed

- Fixed dark mode toggles in a "child" screen not updating a "parent" screen https://github.com/Textualize/textual/issues/1999

## [0.20.1] - 2023-04-18

### Fix
Expand Down
6 changes: 6 additions & 0 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1986,6 +1986,12 @@ def refresh_css(self, animate: bool = True) -> None:
stylesheet.reparse()
stylesheet.update(self.app, animate=animate)
self.screen._refresh_layout(self.size, full=True)
# 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.
for screen in self.screen_stack:
if screen != self.screen:
stylesheet.update(screen, animate=animate)

def _display(self, screen: Screen, renderable: RenderableType | None) -> None:
"""Display a renderable within a sync.
Expand Down

0 comments on commit 60542c5

Please sign in to comment.