Add linux-theme-detection feature through mundy

This commit is contained in:
Héctor Ramón Jiménez 2025-09-08 09:49:11 +02:00
parent ab7eb88951
commit e92c87061d
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 566 additions and 50 deletions

View file

@ -25,6 +25,7 @@ pub use iced_futures as futures;
pub use task::Task;
pub use user_interface::UserInterface;
use crate::core::theme;
use crate::core::widget;
use crate::futures::futures::channel::oneshot;
@ -56,6 +57,9 @@ pub enum Action<T> {
/// Run a system action.
System(system::Action),
/// Change the default system theme mode of all windows.
ChangeTheme(theme::Mode),
/// Recreate all user interfaces and redraw all windows.
Reload,
@ -82,6 +86,7 @@ impl<T> Action<T> {
Action::Clipboard(action) => Err(Action::Clipboard(action)),
Action::Window(action) => Err(Action::Window(action)),
Action::System(action) => Err(Action::System(action)),
Action::ChangeTheme(mode) => Err(Action::ChangeTheme(mode)),
Action::Reload => Err(Action::Reload),
Action::Exit => Err(Action::Exit),
}
@ -106,6 +111,9 @@ where
}
Action::Window(_) => write!(f, "Action::Window"),
Action::System(action) => write!(f, "Action::System({action:?})"),
Action::ChangeTheme(mode) => {
write!(f, "Action::ChangeTheme({mode:?})")
}
Action::Reload => write!(f, "Action::Reload"),
Action::Exit => write!(f, "Action::Exit"),
}