summaryrefslogtreecommitdiffstats
path: root/examples/screenshot
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-01-24 15:55:24 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-01-24 15:55:24 +0100
commitf8337b8da7ff6bcf876b54d1c7dac460d2e03747 (patch)
tree495d96fc62b23af7ce2622e87892ca823f1c61fc /examples/screenshot
parent75a6f32a5ef49bb8e6d16506d84b07822a33c41b (diff)
downloadiced-f8337b8da7ff6bcf876b54d1c7dac460d2e03747.tar.gz
iced-f8337b8da7ff6bcf876b54d1c7dac460d2e03747.tar.bz2
iced-f8337b8da7ff6bcf876b54d1c7dac460d2e03747.zip
Add helper functions for alignment to `widget` module
Diffstat (limited to 'examples/screenshot')
-rw-r--r--examples/screenshot/src/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/screenshot/src/main.rs b/examples/screenshot/src/main.rs
index 5c105f6c..7766542d 100644
--- a/examples/screenshot/src/main.rs
+++ b/examples/screenshot/src/main.rs
@@ -1,5 +1,7 @@
use iced::keyboard;
-use iced::widget::{button, column, container, image, row, text, text_input};
+use iced::widget::{
+ button, center_y, column, container, image, row, text, text_input,
+};
use iced::window;
use iced::window::screenshot::{self, Screenshot};
use iced::{
@@ -131,8 +133,8 @@ impl Example {
text("Press the button to take a screenshot!").into()
};
- let image = container(image)
- .center_y(FillPortion(2))
+ let image = center_y(image)
+ .height(FillPortion(2))
.padding(10)
.style(container::rounded_box);
@@ -211,7 +213,7 @@ impl Example {
.spacing(40)
};
- let side_content = container(controls).center_y(Fill);
+ let side_content = center_y(controls);
let content = row![side_content, image]
.spacing(10)