diff options
author | 2021-10-31 16:53:18 +0700 | |
---|---|---|
committer | 2021-10-31 16:53:18 +0700 | |
commit | d36ce33a95c277ee8fe45555df17daf21ef02ef8 (patch) | |
tree | 57bc16dda40405c33447bb59a78a4ba33adef7f2 /web/src/widget | |
parent | 661cb5736ecc6e7810591216aa541db582a2fcc0 (diff) | |
download | iced-d36ce33a95c277ee8fe45555df17daf21ef02ef8.tar.gz iced-d36ce33a95c277ee8fe45555df17daf21ef02ef8.tar.bz2 iced-d36ce33a95c277ee8fe45555df17daf21ef02ef8.zip |
Reintroduce `Box` for `style_sheet` in `Button`
Diffstat (limited to 'web/src/widget')
-rw-r--r-- | web/src/widget/button.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/src/widget/button.rs b/web/src/widget/button.rs index 1ae78201..88137607 100644 --- a/web/src/widget/button.rs +++ b/web/src/widget/button.rs @@ -51,7 +51,7 @@ pub struct Button<'a, Message> { #[allow(dead_code)] min_height: u32, padding: Padding, - style: &'a dyn StyleSheet, + style: Box<dyn StyleSheet + 'a>, } impl<'a, Message> Button<'a, Message> { @@ -104,8 +104,8 @@ impl<'a, Message> Button<'a, Message> { } /// Sets the style of the [`Button`]. - pub fn style(mut self, style: &'a dyn StyleSheet) -> Self { - self.style = style; + pub fn style(mut self, style: impl Into<Box<dyn StyleSheet + 'a>>) -> Self { + self.style = style.into(); self } |