Remove Renderer trait for Checkbox

This commit is contained in:
Héctor Ramón Jiménez 2021-10-21 18:50:27 +07:00
parent b6ae87ae55
commit 7c08c6bd13
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
8 changed files with 40 additions and 82 deletions

View file

@ -108,7 +108,7 @@ impl Sandbox for Styling {
"Check me!",
Message::CheckboxToggled,
)
.style(self.theme);
.style(self.theme.into());
let toggler = Toggler::new(
self.toggler_value,
@ -239,11 +239,11 @@ mod style {
}
}
impl From<Theme> for Box<dyn checkbox::StyleSheet> {
impl From<Theme> for &'static dyn checkbox::StyleSheet {
fn from(theme: Theme) -> Self {
match theme {
Theme::Light => Default::default(),
Theme::Dark => dark::Checkbox.into(),
Theme::Dark => &dark::Checkbox,
}
}
}