summaryrefslogtreecommitdiffstats
path: root/examples/layout
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-12 15:11:30 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-12 15:14:43 +0200
commitf9dd5cbb099bbe44a57b6369be54a442363b7a8d (patch)
treefe16084bc47faadc32d698aa446ea202f7949a4c /examples/layout
parentbe06060117da061ad8cad94ab0830c06def6b147 (diff)
downloadiced-f9dd5cbb099bbe44a57b6369be54a442363b7a8d.tar.gz
iced-f9dd5cbb099bbe44a57b6369be54a442363b7a8d.tar.bz2
iced-f9dd5cbb099bbe44a57b6369be54a442363b7a8d.zip
Introduce helper methods for alignment for all widgets
Diffstat (limited to 'examples/layout')
-rw-r--r--examples/layout/src/main.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/layout/src/main.rs b/examples/layout/src/main.rs
index 2e774415..2bc7fb30 100644
--- a/examples/layout/src/main.rs
+++ b/examples/layout/src/main.rs
@@ -5,8 +5,8 @@ use iced::widget::{
pick_list, row, scrollable, text,
};
use iced::{
- color, Alignment, Element, Font, Length, Point, Rectangle, Renderer,
- Subscription, Theme,
+ color, Element, Font, Length, Point, Rectangle, Renderer, Subscription,
+ Theme,
};
pub fn main() -> iced::Result {
@@ -74,7 +74,7 @@ impl Layout {
pick_list(Theme::ALL, Some(&self.theme), Message::ThemeSelected),
]
.spacing(20)
- .align_items(Alignment::Center);
+ .center_y();
let example = center(if self.explain {
self.example.view().explain(color!(0x0000ff))
@@ -234,7 +234,7 @@ fn application<'a>() -> Element<'a, Message> {
square(40),
]
.padding(10)
- .align_items(Alignment::Center),
+ .center_y(),
)
.style(|theme| {
let palette = theme.extended_palette();
@@ -248,7 +248,7 @@ fn application<'a>() -> Element<'a, Message> {
.spacing(40)
.padding(10)
.width(200)
- .align_items(Alignment::Center),
+ .center_x(),
)
.style(container::rounded_box)
.center_y(Length::Fill);
@@ -263,7 +263,7 @@ fn application<'a>() -> Element<'a, Message> {
"The end"
]
.spacing(40)
- .align_items(Alignment::Center)
+ .center_x()
.width(Length::Fill),
)
.height(Length::Fill),