From a206d22670eda60d6364444f690633dc11e75a41 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 31 May 2022 05:27:27 +0200 Subject: Use `Theme` background in `styling` example --- examples/styling/src/main.rs | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'examples') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 044f75a9..3109d7fb 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -147,7 +147,6 @@ impl Sandbox for Styling { .height(Length::Fill) .center_x() .center_y() - .style(self.theme) .into() } @@ -160,9 +159,7 @@ impl Sandbox for Styling { } mod style { - use iced::{ - checkbox, container, progress_bar, rule, scrollable, text_input, - }; + use iced::{checkbox, progress_bar, rule, scrollable, text_input}; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Theme { @@ -180,15 +177,6 @@ mod style { } } - impl<'a> From for Box { - fn from(theme: Theme) -> Self { - match theme { - Theme::Light => Default::default(), - Theme::Dark => dark::Container.into(), - } - } - } - impl<'a> From for Box { fn from(theme: Theme) -> Self { match theme { @@ -236,8 +224,7 @@ mod style { mod dark { use iced::{ - checkbox, container, progress_bar, rule, scrollable, text_input, - Color, + checkbox, progress_bar, rule, scrollable, text_input, Color, }; const SURFACE: Color = Color::from_rgb( @@ -264,18 +251,6 @@ mod style { 0xC4 as f32 / 255.0, ); - pub struct Container; - - impl container::StyleSheet for Container { - fn style(&self) -> container::Style { - container::Style { - background: Color::from_rgb8(0x36, 0x39, 0x3F).into(), - text_color: Color::WHITE.into(), - ..container::Style::default() - } - } - } - pub struct TextInput; impl text_input::StyleSheet for TextInput { -- cgit