diff options
author | 2021-10-31 17:42:43 +0700 | |
---|---|---|
committer | 2021-10-31 17:42:43 +0700 | |
commit | 0c76e0307ff7d4450c354812f8a25047f24948b4 (patch) | |
tree | c4ab989d99c65e2099a39d1e2f7a29db4816443b /native/src/widget/slider.rs | |
parent | eed19dcf81334d0849744f1918ba880d5a7acc1c (diff) | |
download | iced-0c76e0307ff7d4450c354812f8a25047f24948b4.tar.gz iced-0c76e0307ff7d4450c354812f8a25047f24948b4.tar.bz2 iced-0c76e0307ff7d4450c354812f8a25047f24948b4.zip |
Reintroduce `Box` for `style_sheet` in `Slider`
Diffstat (limited to 'native/src/widget/slider.rs')
-rw-r--r-- | native/src/widget/slider.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/native/src/widget/slider.rs b/native/src/widget/slider.rs index 977a5240..ee9db6cf 100644 --- a/native/src/widget/slider.rs +++ b/native/src/widget/slider.rs @@ -50,7 +50,7 @@ pub struct Slider<'a, T, Message> { on_release: Option<Message>, width: Length, height: u16, - style_sheet: &'a dyn StyleSheet, + style_sheet: Box<dyn StyleSheet + 'a>, } impl<'a, T, Message> Slider<'a, T, Message> @@ -127,8 +127,11 @@ where } /// Sets the style of the [`Slider`]. - pub fn style(mut self, style_sheet: &'a dyn StyleSheet) -> Self { - self.style_sheet = style_sheet; + pub fn style( + mut self, + style_sheet: impl Into<Box<dyn StyleSheet + 'a>>, + ) -> Self { + self.style_sheet = style_sheet.into(); self } |