better fix

This commit is contained in:
Will McGugan
2025-09-28 20:31:17 +01:00
parent b16c7bcb2d
commit 43970ae198

View File

@@ -1419,7 +1419,7 @@ class App(Generic[ReturnType], DOMNode):
raise InvalidThemeError(message)
return theme_name
async def _watch_theme(self, theme_name: str) -> None:
def _watch_theme(self, theme_name: str) -> None:
"""Apply a theme to the application.
This method is called when the theme reactive attribute is set.
@@ -3657,8 +3657,9 @@ class App(Generic[ReturnType], DOMNode):
stylesheet.reparse()
stylesheet.update(self.app, animate=animate)
try:
self.screen._refresh_layout(self.size)
self.screen._css_update_count = self._css_update_count
if self.screen.is_mounted:
self.screen._refresh_layout(self.size)
self.screen._css_update_count = self._css_update_count
except ScreenError:
pass
# The other screens in the stack will need to know about some style