ThemeFn

Trait ThemeFn 

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

The theme logic of some Daemon.

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

iced provides two implementors:

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

Required Methods§

Source

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

Returns the theme of the Daemon for the current state and window.

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, Id) -> T, T: Into<Option<Theme>>,

Source§

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