From ae656c21c1971134470445e6f0dc01546db01d10 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 20 Apr 2023 11:39:12 +0100 Subject: [PATCH 1/2] Refresh the CSS for all screens in an app's stack, when asked to refresh Addresses #1999. --- src/textual/app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/textual/app.py b/src/textual/app.py index 3656b08f67..77311a522d 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -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. From 61dc08dd995a699dc27310f6451e9866fffbcf65 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 20 Apr 2023 11:42:14 +0100 Subject: [PATCH 2/2] Update the CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aa50b167b..6f4edcf95d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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