mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
fix for dark switch (#2585)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user