diff options
author | 2024-06-16 20:24:41 +0200 | |
---|---|---|
committer | 2024-06-16 20:24:41 +0200 | |
commit | 95d4adb55e485c01eec839736f328be26f2ccab6 (patch) | |
tree | 2676e3cb8ec17c5bf1cd561d97932ae302551dfd /widget/src/helpers.rs | |
parent | e6d0b3bda5042a1017a5944a5227c97e0ed6caf9 (diff) | |
parent | b5c5a016c4f2b608a740b37c494186557a064f48 (diff) | |
download | iced-95d4adb55e485c01eec839736f328be26f2ccab6.tar.gz iced-95d4adb55e485c01eec839736f328be26f2ccab6.tar.bz2 iced-95d4adb55e485c01eec839736f328be26f2ccab6.zip |
Merge pull request #2463 from iced-rs/task-api
`Task` API
Diffstat (limited to 'widget/src/helpers.rs')
-rw-r--r-- | widget/src/helpers.rs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index 016bafbb..62343a55 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -12,7 +12,7 @@ use crate::pick_list::{self, PickList}; use crate::progress_bar::{self, ProgressBar}; use crate::radio::{self, Radio}; use crate::rule::{self, Rule}; -use crate::runtime::Command; +use crate::runtime::{Action, Task}; use crate::scrollable::{self, Scrollable}; use crate::slider::{self, Slider}; use crate::text::{self, Text}; @@ -275,7 +275,7 @@ where state: &mut Tree, layout: Layout<'_>, renderer: &Renderer, - operation: &mut dyn operation::Operation<Message>, + operation: &mut dyn operation::Operation<()>, ) { self.content .as_widget() @@ -477,7 +477,7 @@ where tree: &mut Tree, layout: Layout<'_>, renderer: &Renderer, - operation: &mut dyn operation::Operation<Message>, + operation: &mut dyn operation::Operation<()>, ) { let children = [&self.base, &self.top] .into_iter() @@ -929,19 +929,13 @@ where } /// Focuses the previous focusable widget. -pub fn focus_previous<Message>() -> Command<Message> -where - Message: 'static, -{ - Command::widget(operation::focusable::focus_previous()) +pub fn focus_previous<T>() -> Task<T> { + Task::effect(Action::widget(operation::focusable::focus_previous())) } /// Focuses the next focusable widget. -pub fn focus_next<Message>() -> Command<Message> -where - Message: 'static, -{ - Command::widget(operation::focusable::focus_next()) +pub fn focus_next<T>() -> Task<T> { + Task::effect(Action::widget(operation::focusable::focus_next())) } /// A container intercepting mouse events. |