fix for dark switch (#2585)

This commit is contained in:
Will McGugan
2023-05-17 07:44:36 +01:00
committed by GitHub
parent 8753aa5ed0
commit c12fa0e4da
2 changed files with 2 additions and 8 deletions

View File

@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed `TreeNode.toggle` and `TreeNode.toggle_all` not posting a `Tree.NodeExpanded` or `Tree.NodeCollapsed` message https://github.com/Textualize/textual/issues/2535
- `footer--description` component class was being ignored https://github.com/Textualize/textual/issues/2544
- Pasting empty selection in `Input` would raise an exception https://github.com/Textualize/textual/issues/2563
- Fix for setting dark in App `__init__` https://github.com/Textualize/textual/issues/2583
- Fix issue with scrolling and docks https://github.com/Textualize/textual/issues/2525
### Added

View File

@@ -604,14 +604,7 @@ class App(Generic[ReturnType], DOMNode):
"""
self.set_class(dark, "-dark-mode")
self.set_class(not dark, "-light-mode")
try:
self.refresh_css()
except ScreenStackError:
# It's possible that `dark` can be set before we have a default
# screen, in an app's `on_load`, for example. So let's eat the
# ScreenStackError -- the above styles will be handled once the
# screen is spun up anyway.
pass
self.call_later(self.refresh_css)
def get_driver_class(self) -> Type[Driver]:
"""Get a driver class for this platform.