Use winit to obtain current theme::Mode

This commit is contained in:
Héctor Ramón Jiménez 2025-09-08 05:16:20 +02:00
parent 5c7ae8a3d6
commit 0111f514a1
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
25 changed files with 208 additions and 602 deletions

View file

@ -2063,7 +2063,7 @@ where
/// A widget that applies any `Theme` to its contents.
pub fn themer<'a, Message, OldTheme, NewTheme, Renderer>(
new_theme: NewTheme,
to_theme: impl Fn(&OldTheme) -> NewTheme,
content: impl Into<Element<'a, Message, NewTheme, Renderer>>,
) -> Themer<
'a,
@ -2077,7 +2077,7 @@ where
Renderer: core::Renderer,
NewTheme: Clone,
{
Themer::new(move |_| new_theme.clone(), content)
Themer::new(to_theme, content)
}
/// Creates a [`PaneGrid`] with the given [`pane_grid::State`] and view function.