Implement Widget::draw for TextInput
This commit is contained in:
parent
954d6349a8
commit
e914888f57
16 changed files with 381 additions and 339 deletions
|
|
@ -39,7 +39,7 @@ pub struct TextInput<'a, Message> {
|
|||
size: Option<u16>,
|
||||
on_change: Rc<Box<dyn Fn(String) -> Message>>,
|
||||
on_submit: Option<Message>,
|
||||
style_sheet: Box<dyn StyleSheet>,
|
||||
style_sheet: &'a dyn StyleSheet,
|
||||
}
|
||||
|
||||
impl<'a, Message> TextInput<'a, Message> {
|
||||
|
|
@ -112,8 +112,8 @@ impl<'a, Message> TextInput<'a, Message> {
|
|||
}
|
||||
|
||||
/// Sets the style of the [`TextInput`].
|
||||
pub fn style(mut self, style: impl Into<Box<dyn StyleSheet>>) -> Self {
|
||||
self.style_sheet = style.into();
|
||||
pub fn style(mut self, style_sheet: &'a dyn StyleSheet) -> Self {
|
||||
self.style_sheet = style_sheet;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue