summaryrefslogtreecommitdiffstats
path: root/native/src/command/action.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-08-05 22:31:26 +0200
committerLibravatar GitHub <noreply@github.com>2022-08-05 22:31:26 +0200
commitf294c2d16249ce8b7989f8af6332678f53d8fb12 (patch)
treebb8d6f00fe25de9187b1d3b90a88ae95225b7428 /native/src/command/action.rs
parenta003e797e8a1bb5d365c1db5de6af88e61a47329 (diff)
parentad5bd0970d7106a97d455a164a582ab1d0bff18b (diff)
downloadiced-f294c2d16249ce8b7989f8af6332678f53d8fb12.tar.gz
iced-f294c2d16249ce8b7989f8af6332678f53d8fb12.tar.bz2
iced-f294c2d16249ce8b7989f8af6332678f53d8fb12.zip
Merge pull request #1399 from iced-rs/widget-operations
Widget Operations
Diffstat (limited to 'native/src/command/action.rs')
-rw-r--r--native/src/command/action.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/native/src/command/action.rs b/native/src/command/action.rs
index 1bb03cef..3fb02899 100644
--- a/native/src/command/action.rs
+++ b/native/src/command/action.rs
@@ -1,5 +1,6 @@
use crate::clipboard;
use crate::system;
+use crate::widget;
use crate::window;
use iced_futures::MaybeSend;
@@ -23,6 +24,9 @@ pub enum Action<T> {
/// Run a system action.
System(system::Action<T>),
+
+ /// Run a widget action.
+ Widget(widget::Action<T>),
}
impl<T> Action<T> {
@@ -34,6 +38,7 @@ impl<T> Action<T> {
f: impl Fn(T) -> A + 'static + MaybeSend + Sync,
) -> Action<A>
where
+ A: 'static,
T: 'static,
{
use iced_futures::futures::FutureExt;
@@ -43,6 +48,7 @@ impl<T> Action<T> {
Self::Clipboard(action) => Action::Clipboard(action.map(f)),
Self::Window(window) => Action::Window(window),
Self::System(system) => Action::System(system.map(f)),
+ Self::Widget(widget) => Action::Widget(widget.map(f)),
}
}
}
@@ -56,6 +62,7 @@ impl<T> fmt::Debug for Action<T> {
}
Self::Window(action) => write!(f, "Action::Window({:?})", action),
Self::System(action) => write!(f, "Action::System({:?})", action),
+ Self::Widget(_action) => write!(f, "Action::Widget"),
}
}
}