diff --git a/src/application.rs b/src/application.rs index ef547cea..dfcc4c00 100644 --- a/src/application.rs +++ b/src/application.rs @@ -530,9 +530,19 @@ where } } -/// TODO +/// 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>`. pub trait ThemeFn { - /// TODO + /// 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. fn theme(&self, state: &State) -> Option; } diff --git a/src/daemon.rs b/src/daemon.rs index 2a4451e0..1e4143db 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -317,9 +317,19 @@ where } } -/// TODO +/// 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>`. pub trait ThemeFn { - /// TODO + /// 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. fn theme(&self, state: &State, window: window::Id) -> Option; }