Skip to main content

set_app_theme

Function set_app_theme 

Source
pub fn set_app_theme(theme: Theme)
Expand description

Force the app’s active Theme, overriding whatever the platform’s own light/dark preference would otherwise select — reaching BOTH delivery paths (widget paint/layout via RenderRoot::set_theme, and use_context::<Theme>() via provide_context) the next time the running shell polls ThemeOverrideWatcher::poll (once per frame — see the module docs).

Callable from any thread (see the module docs’ thread contract); the process-wide slot is a plain Mutex, not a UI-thread-only primitive.