summaryrefslogtreecommitdiffstats
path: root/native/src/widget
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/widget')
-rw-r--r--native/src/widget/button.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/native/src/widget/button.rs b/native/src/widget/button.rs
index a577fe84..588833a4 100644
--- a/native/src/widget/button.rs
+++ b/native/src/widget/button.rs
@@ -66,7 +66,7 @@ pub struct Button<'a, Message, Renderer> {
min_width: u32,
min_height: u32,
padding: Padding,
- style_sheet: &'a dyn StyleSheet,
+ style_sheet: Box<dyn StyleSheet + 'a>,
}
impl<'a, Message, Renderer> Button<'a, Message, Renderer>
@@ -131,8 +131,11 @@ where
}
/// Sets the style of the [`Button`].
- 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
}
}