Wire up styling to Radio in iced_native

This commit is contained in:
Héctor Ramón Jiménez 2021-10-20 19:06:53 +07:00
parent cc560aca18
commit d39ad717ed
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
11 changed files with 97 additions and 135 deletions

View file

@ -76,7 +76,7 @@ impl Sandbox for ScrollableDemo {
Some(*theme),
Message::ThemeChanged,
)
.style(*theme),
.style(theme.clone().into()),
)
},
);

View file

@ -25,11 +25,11 @@ impl From<Theme> for &'static dyn container::StyleSheet {
}
}
impl From<Theme> for Box<dyn radio::StyleSheet> {
impl From<Theme> for &'static dyn radio::StyleSheet {
fn from(theme: Theme) -> Self {
match theme {
Theme::Light => Default::default(),
Theme::Dark => dark::Radio.into(),
Theme::Dark => &dark::Radio,
}
}
}