Implement Widget::draw for TextInput

This commit is contained in:
Héctor Ramón Jiménez 2021-10-20 18:40:39 +07:00
parent 954d6349a8
commit e914888f57
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
16 changed files with 381 additions and 339 deletions

View file

@ -77,7 +77,7 @@ impl Sandbox for Styling {
)
.padding(10)
.size(20)
.style(self.theme);
.style(self.theme.into());
let button = Button::new(&mut self.button, Text::new("Submit"))
.padding(10)
@ -194,11 +194,11 @@ mod style {
}
}
impl From<Theme> for Box<dyn text_input::StyleSheet> {
impl From<Theme> for &'static dyn text_input::StyleSheet {
fn from(theme: Theme) -> Self {
match theme {
Theme::Light => Default::default(),
Theme::Dark => dark::TextInput.into(),
Theme::Dark => &dark::TextInput,
}
}
}