summaryrefslogtreecommitdiffstats
path: root/examples/component/src
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/component/src
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/component/src')
-rw-r--r--examples/component/src/main.rs6
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()
}