summaryrefslogtreecommitdiffstats
path: root/native/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:14:10 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:14:10 +0700
commitbd7b086ec1f9d428945f05fb12bda157f9e77dfd (patch)
tree4be12be5f1c96d54233633ba14bd6e0360a7fa7f /native/src/widget
parentd758006ee91aa0fdb70eaa67abbfad36be02c7be (diff)
downloadiced-bd7b086ec1f9d428945f05fb12bda157f9e77dfd.tar.gz
iced-bd7b086ec1f9d428945f05fb12bda157f9e77dfd.tar.bz2
iced-bd7b086ec1f9d428945f05fb12bda157f9e77dfd.zip
Reintroduce `Box` for `style_sheet` in `Radio`
Diffstat (limited to 'native/src/widget')
-rw-r--r--native/src/widget/radio.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs
index afe85b76..eb732dc3 100644
--- a/native/src/widget/radio.rs
+++ b/native/src/widget/radio.rs
@@ -53,7 +53,7 @@ pub struct Radio<'a, Message, Renderer: text::Renderer> {
text_size: Option<u16>,
text_color: Option<Color>,
font: Renderer::Font,
- style_sheet: &'a dyn StyleSheet,
+ style_sheet: Box<dyn StyleSheet + 'a>,
}
impl<'a, Message, Renderer: text::Renderer> Radio<'a, Message, Renderer>
@@ -135,8 +135,11 @@ where
}
/// Sets the style of the [`Radio`] 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
}
}