From d5bc610d0139fb331a59fc904a932d156f637391 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 26 May 2022 23:12:11 +0200 Subject: Fix examples and doc-tests --- examples/styling/src/main.rs | 58 +++----------------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) (limited to 'examples/styling/src') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index e6c4ac37..82876cb4 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -92,8 +92,7 @@ impl Sandbox for Styling { 0.0..=100.0, self.slider_value, Message::SliderChanged, - ) - .style(self.theme); + ); let progress_bar = ProgressBar::new(0.0..=100.0, self.slider_value).style(self.theme); @@ -159,8 +158,8 @@ impl Sandbox for Styling { mod style { use iced::{ - checkbox, container, progress_bar, radio, rule, scrollable, slider, - text_input, toggler, + checkbox, container, progress_bar, radio, rule, scrollable, text_input, + toggler, }; #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -215,15 +214,6 @@ mod style { } } - impl<'a> From for Box { - fn from(theme: Theme) -> Self { - match theme { - Theme::Light => Default::default(), - Theme::Dark => dark::Slider.into(), - } - } - } - impl From for Box { fn from(theme: Theme) -> Self { match theme { @@ -262,7 +252,7 @@ mod style { mod dark { use iced::{ - checkbox, container, progress_bar, radio, rule, scrollable, slider, + checkbox, container, progress_bar, radio, rule, scrollable, text_input, toggler, Color, }; @@ -408,46 +398,6 @@ mod style { } } - pub struct Slider; - - impl slider::StyleSheet for Slider { - fn active(&self) -> slider::Style { - slider::Style { - rail_colors: (ACTIVE, Color { a: 0.1, ..ACTIVE }), - handle: slider::Handle { - shape: slider::HandleShape::Circle { radius: 9.0 }, - color: ACTIVE, - border_width: 0.0, - border_color: Color::TRANSPARENT, - }, - } - } - - fn hovered(&self) -> slider::Style { - let active = self.active(); - - slider::Style { - handle: slider::Handle { - color: HOVERED, - ..active.handle - }, - ..active - } - } - - fn dragging(&self) -> slider::Style { - let active = self.active(); - - slider::Style { - handle: slider::Handle { - color: Color::from_rgb(0.85, 0.85, 0.85), - ..active.handle - }, - ..active - } - } - } - pub struct ProgressBar; impl progress_bar::StyleSheet for ProgressBar { -- cgit