ThemeFn

Trait ThemeFn 

Source
pub trait ThemeFn<State, Theme> {
    // Required method
    fn theme(&self, state: &State) -> Option<Theme>;
}
Expand description

The theme logic of some Application.

Any implementors of this trait can be provided as an argument to Application::theme.

iced provides two implementors:

  • the built-in Theme itself
  • and any Fn(&State) -> impl Into<Option<Theme>>.

Required Methods§

Source

fn theme(&self, state: &State) -> Option<Theme>

Returns the theme of the Application for the current state.

If None is returned, iced will try to use a theme that matches the system color scheme.

Implementors§

Source§

impl<F, T, State, Theme> ThemeFn<State, Theme> for F
where F: Fn(&State) -> T, T: Into<Option<Theme>>,

Source§

impl<State> ThemeFn<State, Theme> for Theme