diff options
author | 2024-07-12 15:11:30 +0200 | |
---|---|---|
committer | 2024-07-12 15:14:43 +0200 | |
commit | f9dd5cbb099bbe44a57b6369be54a442363b7a8d (patch) | |
tree | fe16084bc47faadc32d698aa446ea202f7949a4c /examples/component/src | |
parent | be06060117da061ad8cad94ab0830c06def6b147 (diff) | |
download | iced-f9dd5cbb099bbe44a57b6369be54a442363b7a8d.tar.gz iced-f9dd5cbb099bbe44a57b6369be54a442363b7a8d.tar.bz2 iced-f9dd5cbb099bbe44a57b6369be54a442363b7a8d.zip |
Introduce helper methods for alignment for all widgets
Diffstat (limited to 'examples/component/src')
-rw-r--r-- | examples/component/src/main.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/component/src/main.rs b/examples/component/src/main.rs index 5625f12a..14d3d9ba 100644 --- a/examples/component/src/main.rs +++ b/examples/component/src/main.rs @@ -34,7 +34,6 @@ impl Component { } mod numeric_input { - use iced::alignment::{self, Alignment}; use iced::widget::{button, component, row, text, text_input, Component}; use iced::{Element, Length, Size}; @@ -108,8 +107,7 @@ mod numeric_input { text(label) .width(Length::Fill) .height(Length::Fill) - .horizontal_alignment(alignment::Horizontal::Center) - .vertical_alignment(alignment::Vertical::Center), + .center(), ) .width(40) .height(40) @@ -130,7 +128,7 @@ mod numeric_input { .padding(10), button("+", Event::IncrementPressed), ] - .align_items(Alignment::Center) + .center_y() .spacing(10) .into() } |