Add new System variant to Action

This commit is contained in:
Richard 2022-02-16 19:20:26 -03:00
parent 6e93713197
commit fed8da1c90
5 changed files with 14 additions and 0 deletions

View file

@ -1,4 +1,5 @@
use crate::clipboard;
use crate::system;
use crate::window;
use iced_futures::MaybeSend;
@ -17,6 +18,9 @@ pub enum Action<T> {
/// Run a window action.
Window(window::Action),
/// Run a system action.
System(system::Action),
}
impl<T> Action<T> {
@ -34,6 +38,7 @@ impl<T> Action<T> {
Self::Future(future) => Action::Future(Box::pin(future.map(f))),
Self::Clipboard(action) => Action::Clipboard(action.map(f)),
Self::Window(window) => Action::Window(window),
Self::System(system) => Action::System(system),
}
}
}
@ -46,6 +51,7 @@ impl<T> fmt::Debug for Action<T> {
write!(f, "Action::Clipboard({:?})", action)
}
Self::Window(action) => write!(f, "Action::Window({:?})", action),
Self::System(action) => write!(f, "Action::System({:?})", action),
}
}
}