summaryrefslogtreecommitdiffstats
path: root/examples/screenshot
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-06-06 15:39:29 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-06-06 15:39:29 +0200
commit5ed945287745f5c40ca5cc8013458eee89e76f35 (patch)
treed42fc3392a816eb0b6d042a6c6803dce7a775877 /examples/screenshot
parent233196eb14b40f8bd5201ea0262571f82136ad53 (diff)
downloadiced-5ed945287745f5c40ca5cc8013458eee89e76f35.tar.gz
iced-5ed945287745f5c40ca5cc8013458eee89e76f35.tar.bz2
iced-5ed945287745f5c40ca5cc8013458eee89e76f35.zip
Use `Container::Box` in `screenshot` example
Diffstat (limited to 'examples/screenshot')
-rw-r--r--examples/screenshot/src/main.rs18
1 files changed, 1 insertions, 17 deletions
diff --git a/examples/screenshot/src/main.rs b/examples/screenshot/src/main.rs
index 29d961d9..cfdddd72 100644
--- a/examples/screenshot/src/main.rs
+++ b/examples/screenshot/src/main.rs
@@ -154,7 +154,7 @@ impl Application for Example {
let image = container(image)
.padding(10)
- .style(Container::Custom(Box::new(ScreenshotDisplayContainer)))
+ .style(Container::Box)
.width(Length::FillPortion(2))
.height(Length::Fill)
.center_x()
@@ -272,22 +272,6 @@ impl Application for Example {
}
}
-struct ScreenshotDisplayContainer;
-
-impl container::StyleSheet for ScreenshotDisplayContainer {
- type Style = Theme;
-
- fn appearance(&self, style: &Self::Style) -> container::Appearance {
- container::Appearance {
- text_color: None,
- background: None,
- border_radius: 5.0,
- border_width: 4.0,
- border_color: style.palette().primary,
- }
- }
-}
-
async fn save_to_png(screenshot: Screenshot) -> Result<String, PngError> {
let path = "screenshot.png".to_string();
img::save_buffer(