Expand description
Global theme provider: use_theme() and set_theme().
Enums§
- Theme
Mode - Whether the active theme should follow the OS light/dark setting, or is
pinned by the app/user. Mirrors
rosace_core::platform’s enum+atom shape.
Functions§
- register_
theme_ pair - Registers the app’s own light/dark
ThemeData— call once at startup (e.g.rosace_theme::register_theme_pair(crate::theme::light(), crate::theme::dark())) soThemeMode::System/set_theme_modeapply YOUR themes rather than the genericbuilt_in::light_theme()/dark_theme(). A second call is a no-op (first registration wins, matchingOnceLocksemantics) — call it exactly once, before the first frame. - set_
animations - Replaces the active theme with
themeand notifies all subscribers. - set_
theme - set_
theme_ mode - Pins the theme to
mode. PassingThemeMode::Systemre-enables following the OS setting on the nextsync_system_themecall (e.g. the next native env-push, or call it directly to apply immediately). - sync_
system_ theme - Applies the OS brightness (
rosace_core::media_query().is_dark) to the active theme, but only whileuse_theme_mode() == ThemeMode::System— an app/user that pinnedLight/Darkviaset_theme_modeis left alone. Native platform code calls this right after everyrosace_core::set_media_query(..)push. - use_
theme - Returns a clone of the currently active
ThemeData. - use_
theme_ mode - Returns the active theme mode (
Systemby default).