-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dark mode toggle in a stacked screen doesn't cause mode switch in other screens #1999
Comments
Suspect this is fixed. Needs confirmation. |
Checked with Textual version 0.20.1 - the test app mentioned in the discussion seemed stable with theme switches. Then checked with my original app where I had the issue, and seems there are still issues. Here's a sample video: theme_toggle_screens.mp4App code: https://github.com/learnbyexample/TUI-apps/tree/main/PyRegexPlayground Can be installed using Also, what is intended behavior? Each screen will retain the theme it was left in previously? I'd be happy all the screens having a uniform value. So, when switching to a screen, apply the current app theme without even having to check what was the last known value. |
I would expect the |
By the looks of things this comes down to |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Will be fixed by #2339 in the next release. |
Initially reported by @learnbyexample over in discussions, if dark mode is toggled inside a screen, other screens on the stack don't refresh as you'd expect.
Consider this code:
If you run it up and press the "Show Child" button, then press d to toggle dark mode, then press the "Close Me" button, you'll notice that the "parent" screen is still in dark mode. Further, if you then press d you'll notice that nothing happens (because then that screen is switching to dark mode).
When watching a change to dark mode we should refresh the current screen but also alert other screens in the stack that they need to refresh when they become shown.
The text was updated successfully, but these errors were encountered: