diff options
author | 2021-10-31 16:58:02 +0700 | |
---|---|---|
committer | 2021-10-31 16:58:02 +0700 | |
commit | fcc282bd76c88f389d510411b0ae73e1a4eaf317 (patch) | |
tree | 407ad2d80b9a87064787bd3f4b5ee5f3188b4cda /web/src/widget | |
parent | d36ce33a95c277ee8fe45555df17daf21ef02ef8 (diff) | |
download | iced-fcc282bd76c88f389d510411b0ae73e1a4eaf317.tar.gz iced-fcc282bd76c88f389d510411b0ae73e1a4eaf317.tar.bz2 iced-fcc282bd76c88f389d510411b0ae73e1a4eaf317.zip |
Reintroduce `Box` for `style_sheet` in `Checkbox`
Diffstat (limited to 'web/src/widget')
-rw-r--r-- | web/src/widget/checkbox.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/web/src/widget/checkbox.rs b/web/src/widget/checkbox.rs index 095ef47d..844bf862 100644 --- a/web/src/widget/checkbox.rs +++ b/web/src/widget/checkbox.rs @@ -31,7 +31,7 @@ pub struct Checkbox<'a, Message> { id: Option<String>, width: Length, #[allow(dead_code)] - style_sheet: &'a dyn StyleSheet, + style_sheet: Box<dyn StyleSheet + 'a>, } impl<'a, Message> Checkbox<'a, Message> { @@ -64,8 +64,11 @@ impl<'a, Message> Checkbox<'a, Message> { } /// Sets the style of the [`Checkbox`]. - 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 } |