summaryrefslogtreecommitdiffstats
path: root/examples/download_progress
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/download_progress
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/download_progress')
-rw-r--r--examples/download_progress/src/main.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/download_progress/src/main.rs b/examples/download_progress/src/main.rs
index d91e5eab..8064b4ae 100644
--- a/examples/download_progress/src/main.rs
+++ b/examples/download_progress/src/main.rs
@@ -1,7 +1,7 @@
mod download;
use iced::widget::{button, center, column, progress_bar, text, Column};
-use iced::{Alignment, Element, Subscription};
+use iced::{Element, Subscription};
pub fn main() -> iced::Result {
iced::application(
@@ -69,7 +69,7 @@ impl Example {
.padding(10),
)
.spacing(20)
- .align_items(Alignment::End);
+ .align_right();
center(downloads).padding(20).into()
}
@@ -160,7 +160,7 @@ impl Download {
State::Finished => {
column!["Download finished!", button("Start again")]
.spacing(10)
- .align_items(Alignment::Center)
+ .center_x()
.into()
}
State::Downloading { .. } => {
@@ -171,14 +171,14 @@ impl Download {
button("Try again").on_press(Message::Download(self.id)),
]
.spacing(10)
- .align_items(Alignment::Center)
+ .center_x()
.into(),
};
Column::new()
.spacing(10)
.padding(10)
- .align_items(Alignment::Center)
+ .center_x()
.push(progress_bar)
.push(control)
.into()