summaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
Diffstat (limited to 'native/src')
-rw-r--r--native/src/widget/slider.rs9
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
}