How can I change the theme globally and using native code? #5860
-
I want to implement a theme toggle feature. I have read: #5213 Also, I would like to ask for help. Is there any way to change the theme globally and switch the theme using native code (Rust)? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
currently, global are global per instances. So you'll have to make a function in native code that loop over all your window to then call a function in them to change the Palette.color-scheme |
Beta Was this translation helpful? Give feedback.
-
@ogoffart , how exactly would that work? I want to set dark mode for the primary window. AFAIK, I can invoke callbacks from Rust code, but I cannot invoke functions and only functions have a body where I could do |
Beta Was this translation helpful? Give feedback.
currently, global are global per instances.
As you've noticed, they are not shared.
So you'll have to make a function in native code that loop over all your window to then call a function in them to change the Palette.color-scheme