summaryrefslogtreecommitdiffstats
path: root/examples/layout
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-01-24 15:55:24 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-01-24 15:55:24 +0100
commitf8337b8da7ff6bcf876b54d1c7dac460d2e03747 (patch)
tree495d96fc62b23af7ce2622e87892ca823f1c61fc /examples/layout
parent75a6f32a5ef49bb8e6d16506d84b07822a33c41b (diff)
downloadiced-f8337b8da7ff6bcf876b54d1c7dac460d2e03747.tar.gz
iced-f8337b8da7ff6bcf876b54d1c7dac460d2e03747.tar.bz2
iced-f8337b8da7ff6bcf876b54d1c7dac460d2e03747.zip
Add helper functions for alignment to `widget` module
Diffstat (limited to 'examples/layout')
-rw-r--r--examples/layout/src/main.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/layout/src/main.rs b/examples/layout/src/main.rs
index e83a1f7d..b298dce4 100644
--- a/examples/layout/src/main.rs
+++ b/examples/layout/src/main.rs
@@ -2,9 +2,9 @@ use iced::border;
use iced::keyboard;
use iced::mouse;
use iced::widget::{
- button, canvas, center, checkbox, column, container, horizontal_rule,
- horizontal_space, pick_list, pin, row, scrollable, stack, text,
- vertical_rule,
+ button, canvas, center, center_y, checkbox, column, container,
+ horizontal_rule, horizontal_space, pick_list, pin, row, scrollable, stack,
+ text, vertical_rule,
};
use iced::{
color, Center, Element, Fill, Font, Length, Point, Rectangle, Renderer,
@@ -253,15 +253,14 @@ fn application<'a>() -> Element<'a, Message> {
.border(border::color(palette.background.strong.color).width(1))
});
- let sidebar = container(
+ let sidebar = center_y(
column!["Sidebar!", square(50), square(50)]
.spacing(40)
.padding(10)
.width(200)
.align_x(Center),
)
- .style(container::rounded_box)
- .center_y(Fill);
+ .style(container::rounded_box);
let content = container(
scrollable(