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
|
|
@ -76,7 +76,7 @@ impl Sandbox for ScrollableDemo {
|
|||
Some(*theme),
|
||||
Message::ThemeChanged,
|
||||
)
|
||||
.style(theme.clone().into()),
|
||||
.style(*theme),
|
||||
)
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@ impl<'a> From<Theme> for Box<dyn container::StyleSheet + 'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<Theme> for &'static dyn radio::StyleSheet {
|
||||
impl<'a> From<Theme> for Box<dyn radio::StyleSheet + 'a> {
|
||||
fn from(theme: Theme) -> Self {
|
||||
match theme {
|
||||
Theme::Light => Default::default(),
|
||||
Theme::Dark => &dark::Radio,
|
||||
Theme::Dark => dark::Radio.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue