summaryrefslogtreecommitdiffstats
path: root/examples/visible_bounds/src/main.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-06-16 20:24:41 +0200
committerLibravatar GitHub <noreply@github.com>2024-06-16 20:24:41 +0200
commit95d4adb55e485c01eec839736f328be26f2ccab6 (patch)
tree2676e3cb8ec17c5bf1cd561d97932ae302551dfd /examples/visible_bounds/src/main.rs
parente6d0b3bda5042a1017a5944a5227c97e0ed6caf9 (diff)
parentb5c5a016c4f2b608a740b37c494186557a064f48 (diff)
downloadiced-95d4adb55e485c01eec839736f328be26f2ccab6.tar.gz
iced-95d4adb55e485c01eec839736f328be26f2ccab6.tar.bz2
iced-95d4adb55e485c01eec839736f328be26f2ccab6.zip
Merge pull request #2463 from iced-rs/task-api
`Task` API
Diffstat (limited to 'examples/visible_bounds/src/main.rs')
-rw-r--r--examples/visible_bounds/src/main.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/visible_bounds/src/main.rs b/examples/visible_bounds/src/main.rs
index 8030f5b4..b43c0cca 100644
--- a/examples/visible_bounds/src/main.rs
+++ b/examples/visible_bounds/src/main.rs
@@ -5,8 +5,8 @@ use iced::widget::{
};
use iced::window;
use iced::{
- Alignment, Color, Command, Element, Font, Length, Point, Rectangle,
- Subscription, Theme,
+ Alignment, Color, Element, Font, Length, Point, Rectangle, Subscription,
+ Task, Theme,
};
pub fn main() -> iced::Result {
@@ -33,14 +33,14 @@ enum Message {
}
impl Example {
- fn update(&mut self, message: Message) -> Command<Message> {
+ fn update(&mut self, message: Message) -> Task<Message> {
match message {
Message::MouseMoved(position) => {
self.mouse_position = Some(position);
- Command::none()
+ Task::none()
}
- Message::Scrolled | Message::WindowResized => Command::batch(vec![
+ Message::Scrolled | Message::WindowResized => Task::batch(vec![
container::visible_bounds(OUTER_CONTAINER.clone())
.map(Message::OuterBoundsFetched),
container::visible_bounds(INNER_CONTAINER.clone())
@@ -49,12 +49,12 @@ impl Example {
Message::OuterBoundsFetched(outer_bounds) => {
self.outer_bounds = outer_bounds;
- Command::none()
+ Task::none()
}
Message::InnerBoundsFetched(inner_bounds) => {
self.inner_bounds = inner_bounds;
- Command::none()
+ Task::none()
}
}
}