diff options
author | 2024-01-05 17:24:43 +0100 | |
---|---|---|
committer | 2024-01-10 10:01:49 +0100 | |
commit | 22226394f7b1a0e0205b9bb5b3ef9b85a3b406f5 (patch) | |
tree | 22214a4ac6bca5033f6d5a227934288019f6ca60 /examples/lazy/src | |
parent | 0322e820eb40d36a7425246278b7bcb22b7010aa (diff) | |
download | iced-22226394f7b1a0e0205b9bb5b3ef9b85a3b406f5.tar.gz iced-22226394f7b1a0e0205b9bb5b3ef9b85a3b406f5.tar.bz2 iced-22226394f7b1a0e0205b9bb5b3ef9b85a3b406f5.zip |
Introduce `Widget::size_hint` and fix further layout inconsistencies
Diffstat (limited to 'examples/lazy/src')
-rw-r--r-- | examples/lazy/src/main.rs | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/examples/lazy/src/main.rs b/examples/lazy/src/main.rs index 01560598..04df0744 100644 --- a/examples/lazy/src/main.rs +++ b/examples/lazy/src/main.rs @@ -178,35 +178,23 @@ impl Sandbox for App { } }); - column( - items - .into_iter() - .map(|item| { - let button = button("Delete") - .on_press(Message::DeleteItem(item.clone())) - .style(theme::Button::Destructive); - - row![ - text(&item.name) - .style(theme::Text::Color(item.color.into())), - horizontal_space(Length::Fill), - pick_list( - Color::ALL, - Some(item.color), - move |color| { - Message::ItemColorChanged( - item.clone(), - color, - ) - } - ), - button - ] - .spacing(20) - .into() - }) - .collect(), - ) + column(items.into_iter().map(|item| { + let button = button("Delete") + .on_press(Message::DeleteItem(item.clone())) + .style(theme::Button::Destructive); + + row![ + text(&item.name) + .style(theme::Text::Color(item.color.into())), + horizontal_space(Length::Fill), + pick_list(Color::ALL, Some(item.color), move |color| { + Message::ItemColorChanged(item.clone(), color) + }), + button + ] + .spacing(20) + .into() + })) .spacing(10) }); |