Implement Widget::draw for TextInput
This commit is contained in:
parent
954d6349a8
commit
e914888f57
16 changed files with 381 additions and 339 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue