diff options
| author | 2024-08-06 03:19:27 +0200 | |
|---|---|---|
| committer | 2024-08-06 03:22:44 +0200 | |
| commit | 6fbbc30f5cb1f699c61e064ed54fe428d96be7d3 (patch) | |
| tree | ce165aa5f79750b1fe4d05f7380a92759014cef6 /examples/layout | |
| parent | ff0da4dc819a0cb3037502fd2ee82609f25f2fe9 (diff) | |
| download | iced-6fbbc30f5cb1f699c61e064ed54fe428d96be7d3.tar.gz iced-6fbbc30f5cb1f699c61e064ed54fe428d96be7d3.tar.bz2 iced-6fbbc30f5cb1f699c61e064ed54fe428d96be7d3.zip | |
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.
Diffstat (limited to '')
| -rw-r--r-- | examples/layout/src/main.rs | 7 |
1 files changed, 4 insertions, 3 deletions
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) |
