summaryrefslogtreecommitdiffstats
path: root/examples/layout
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-10 10:08:11 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-10 10:08:11 +0100
commit226271148e77a4f8966ce84b0c948c268176d92b (patch)
treef3830d78f064becb762a17cbae9973e4541b1491 /examples/layout
parenta6cbc365037d740ee9bb8d21fffe361cd198477e (diff)
downloadiced-226271148e77a4f8966ce84b0c948c268176d92b.tar.gz
iced-226271148e77a4f8966ce84b0c948c268176d92b.tar.bz2
iced-226271148e77a4f8966ce84b0c948c268176d92b.zip
Use multiple squares instead of `vertical_space` in `layout` example
Diffstat (limited to 'examples/layout')
-rw-r--r--examples/layout/src/main.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/examples/layout/src/main.rs b/examples/layout/src/main.rs
index 3e69e1a8..60dabe54 100644
--- a/examples/layout/src/main.rs
+++ b/examples/layout/src/main.rs
@@ -4,7 +4,7 @@ use iced::mouse;
use iced::theme;
use iced::widget::{
button, canvas, checkbox, column, container, horizontal_space, pick_list,
- row, scrollable, text, vertical_rule, vertical_space,
+ row, scrollable, text, vertical_rule,
};
use iced::{
color, Alignment, Application, Color, Command, Element, Font, Length,
@@ -284,9 +284,19 @@ fn application<'a>() -> Element<'a, Message> {
.center_y();
let content = container(
- scrollable(column!["Content!", vertical_space(2000), "The end"])
- .width(Length::Fill)
- .height(Length::Fill),
+ scrollable(
+ column![
+ "Content!",
+ square(400),
+ square(200),
+ square(400),
+ "The end"
+ ]
+ .spacing(40)
+ .align_items(Alignment::Center)
+ .width(Length::Fill),
+ )
+ .height(Length::Fill),
)
.padding(10);