From 6fbbc30f5cb1f699c61e064ed54fe428d96be7d3 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 6 Aug 2024 03:19:27 +0200 Subject: Implement `row::Wrapping` widget If you have a `Row`, simply call `Row::wrap` at the end to turn it into a `Row` that will wrap its contents. The original alignment of the `Row` is preserved per row wrapped. --- examples/layout/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'examples/layout') diff --git a/examples/layout/src/main.rs b/examples/layout/src/main.rs index f39e24f9..cb33369b 100644 --- a/examples/layout/src/main.rs +++ b/examples/layout/src/main.rs @@ -258,9 +258,10 @@ fn application<'a>() -> Element<'a, Message> { scrollable( column![ "Content!", - square(400), - square(200), - square(400), + row((1..10).map(|i| square(if i % 2 == 0 { 80 } else { 160 }))) + .spacing(20) + .align_y(Center) + .wrap(), "The end" ] .spacing(40) -- cgit