summaryrefslogtreecommitdiffstats
path: root/native/src/widget/action.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-01-14 16:08:36 +0100
committerLibravatar GitHub <noreply@github.com>2023-01-14 16:08:36 +0100
commit5ef0648bf447aaca8b96782643401e54a2bf7759 (patch)
tree634f929a715258a61edfcecd747f95a7d903b3b4 /native/src/widget/action.rs
parent18552f96df5d1fa72c3c87e96a5765f89c340e19 (diff)
parentdaa3f3324d001b634f73779423da605c213e7626 (diff)
downloadiced-5ef0648bf447aaca8b96782643401e54a2bf7759.tar.gz
iced-5ef0648bf447aaca8b96782643401e54a2bf7759.tar.bz2
iced-5ef0648bf447aaca8b96782643401e54a2bf7759.zip
Merge pull request #1649 from iced-rs/generic-widget-operations
Introduce `custom` method to `widget::Operation` trait
Diffstat (limited to '')
-rw-r--r--native/src/widget/action.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/native/src/widget/action.rs b/native/src/widget/action.rs
index 9aa79dec..1e21ff38 100644
--- a/native/src/widget/action.rs
+++ b/native/src/widget/action.rs
@@ -3,6 +3,7 @@ use crate::widget::Id;
use iced_futures::MaybeSend;
+use std::any::Any;
use std::rc::Rc;
/// An operation to be performed on the widget tree.
@@ -84,6 +85,10 @@ where
) {
self.operation.focusable(state, id);
}
+
+ fn custom(&mut self, state: &mut dyn Any, id: Option<&Id>) {
+ self.operation.custom(state, id);
+ }
}
let Self { operation, .. } = self;
@@ -118,6 +123,10 @@ where
self.operation.text_input(state, id);
}
+ fn custom(&mut self, state: &mut dyn Any, id: Option<&Id>) {
+ self.operation.custom(state, id);
+ }
+
fn finish(&self) -> operation::Outcome<B> {
match self.operation.finish() {
operation::Outcome::None => operation::Outcome::None,