Introduce with helper and use sipper in gallery example
This commit is contained in:
parent
9f21eae152
commit
0c528be2ea
8 changed files with 143 additions and 105 deletions
|
|
@ -4,7 +4,7 @@ use download::download;
|
|||
|
||||
use iced::task;
|
||||
use iced::widget::{button, center, column, progress_bar, text, Column};
|
||||
use iced::{Center, Element, Right, Task};
|
||||
use iced::{with, Center, Element, Right, Task};
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
iced::application(
|
||||
|
|
@ -52,7 +52,7 @@ impl Example {
|
|||
|
||||
let task = download.start();
|
||||
|
||||
task.map_with(index, Message::DownloadUpdated)
|
||||
task.map(with(Message::DownloadUpdated, index))
|
||||
}
|
||||
Message::DownloadUpdated(id, update) => {
|
||||
if let Some(download) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue