Implement TextInput in iced_pure

This commit is contained in:
Héctor Ramón Jiménez 2022-02-12 16:11:22 +07:00
parent b2670e8752
commit e3108494e5
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
3 changed files with 849 additions and 567 deletions

View file

@ -6,6 +6,7 @@ mod element;
mod row;
mod scrollable;
mod text;
mod text_input;
mod tree;
pub use button::Button;
@ -16,6 +17,7 @@ pub use element::Element;
pub use row::Row;
pub use scrollable::Scrollable;
pub use text::Text;
pub use text_input::TextInput;
pub use tree::Tree;
use iced_native::event::{self, Event};
@ -127,3 +129,15 @@ where
{
Checkbox::new(is_checked, label, f)
}
pub fn text_input<'a, Message, Renderer>(
placeholder: &str,
value: &str,
on_change: impl Fn(String) -> Message + 'a,
) -> TextInput<'a, Message, Renderer>
where
Message: Clone,
Renderer: iced_native::text::Renderer,
{
TextInput::new(placeholder, value, on_change)
}