summaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 16:53:18 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 16:53:18 +0700
commitd36ce33a95c277ee8fe45555df17daf21ef02ef8 (patch)
tree57bc16dda40405c33447bb59a78a4ba33adef7f2 /native/src
parent661cb5736ecc6e7810591216aa541db582a2fcc0 (diff)
downloadiced-d36ce33a95c277ee8fe45555df17daf21ef02ef8.tar.gz
iced-d36ce33a95c277ee8fe45555df17daf21ef02ef8.tar.bz2
iced-d36ce33a95c277ee8fe45555df17daf21ef02ef8.zip
Reintroduce `Box` for `style_sheet` in `Button`
Diffstat (limited to 'native/src')
-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
}
}