From 11bcb1342796a6fabc7c5b89a15c22c754b014ce Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Oct 2021 15:50:42 +0700 Subject: Wire up styling to `Slider` in `iced_native` --- web/src/widget/slider.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'web/src/widget/slider.rs') diff --git a/web/src/widget/slider.rs b/web/src/widget/slider.rs index f457aa4c..7ec84475 100644 --- a/web/src/widget/slider.rs +++ b/web/src/widget/slider.rs @@ -41,7 +41,7 @@ pub struct Slider<'a, T, Message> { #[allow(dead_code)] width: Length, #[allow(dead_code)] - style: Box, + style_sheet: &'a dyn StyleSheet, } impl<'a, T, Message> Slider<'a, T, Message> @@ -85,7 +85,7 @@ where step: T::from(1), on_change: Rc::new(Box::new(on_change)), width: Length::Fill, - style: Default::default(), + style_sheet: Default::default(), } } @@ -96,8 +96,8 @@ where } /// Sets the style of the [`Slider`]. - pub fn style(mut self, style: impl Into>) -> Self { - self.style = style.into(); + pub fn style(mut self, style_sheet: &'a dyn StyleSheet) -> Self { + self.style_sheet = style_sheet.into(); self } -- cgit From 0c76e0307ff7d4450c354812f8a25047f24948b4 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 17:42:43 +0700 Subject: Reintroduce `Box` for `style_sheet` in `Slider` --- web/src/widget/slider.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'web/src/widget/slider.rs') diff --git a/web/src/widget/slider.rs b/web/src/widget/slider.rs index 7ec84475..8cbf5bd0 100644 --- a/web/src/widget/slider.rs +++ b/web/src/widget/slider.rs @@ -41,7 +41,7 @@ pub struct Slider<'a, T, Message> { #[allow(dead_code)] width: Length, #[allow(dead_code)] - style_sheet: &'a dyn StyleSheet, + style_sheet: Box, } impl<'a, T, Message> Slider<'a, T, Message> @@ -96,7 +96,10 @@ where } /// Sets the style of the [`Slider`]. - pub fn style(mut self, style_sheet: &'a dyn StyleSheet) -> Self { + pub fn style( + mut self, + style_sheet: impl Into>, + ) -> Self { self.style_sheet = style_sheet.into(); self } -- cgit