From 5ed945287745f5c40ca5cc8013458eee89e76f35 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 6 Jun 2023 15:39:29 +0200 Subject: Use `Container::Box` in `screenshot` example --- examples/screenshot/src/main.rs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'examples') 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 { let path = "screenshot.png".to_string(); img::save_buffer( -- cgit