summaryrefslogtreecommitdiffstats
path: root/examples/gradient/src/main.rs
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/gradient/src/main.rs
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/gradient/src/main.rs')
-rw-r--r--examples/gradient/src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/gradient/src/main.rs b/examples/gradient/src/main.rs
index e5b19443..018bab82 100644
--- a/examples/gradient/src/main.rs
+++ b/examples/gradient/src/main.rs
@@ -3,7 +3,7 @@ use iced::gradient;
use iced::widget::{
checkbox, column, container, horizontal_space, row, slider, text,
};
-use iced::{Alignment, Color, Element, Length, Radians, Theme};
+use iced::{Color, Element, Length, Radians, Theme};
pub fn main() -> iced::Result {
tracing_subscriber::fmt::init();
@@ -77,7 +77,7 @@ impl Gradient {
]
.spacing(8)
.padding(8)
- .align_items(Alignment::Center);
+ .center_y();
let transparency_toggle = iced::widget::Container::new(
checkbox("Transparent window", transparent)
@@ -129,6 +129,6 @@ fn color_picker(label: &str, color: Color) -> Element<'_, Color> {
]
.spacing(8)
.padding(8)
- .align_items(Alignment::Center)
+ .center_y()
.into()
}