Skip to main content

use_theme

Function use_theme 

Source
pub fn use_theme(
    id: impl Into<SharedString>,
    cx: &mut App,
) -> Result<(), UnknownThemeError>
Expand description

Activates one of the registered themes by id ("light", "dark", custom) and schedules every open window to repaint.

An unknown id is an error, not a panic: the active theme is left unchanged, no window repaints, and the rejected id comes back in UnknownThemeError.