Reintroduce Box for style_sheet in Radio
This commit is contained in:
parent
d758006ee9
commit
bd7b086ec1
6 changed files with 29 additions and 14 deletions
|
|
@ -38,7 +38,7 @@ pub struct Radio<'a, Message> {
|
|||
id: Option<String>,
|
||||
name: Option<String>,
|
||||
#[allow(dead_code)]
|
||||
style_sheet: &'a dyn StyleSheet,
|
||||
style_sheet: Box<dyn StyleSheet + 'a>,
|
||||
}
|
||||
|
||||
impl<'a, Message> Radio<'a, Message> {
|
||||
|
|
@ -71,8 +71,11 @@ impl<'a, Message> Radio<'a, Message> {
|
|||
}
|
||||
|
||||
/// 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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue