diff options
author | 2023-04-17 23:46:18 +0200 | |
---|---|---|
committer | 2023-04-17 23:46:18 +0200 | |
commit | 619ba9294d5e0f7913f82838d78018fc6714d26a (patch) | |
tree | b0631aa66875e0e9f486665227c306832ac19a5b /examples/todos | |
parent | d206b82ebb7617337cd378bd19542a7abf8a4529 (diff) | |
parent | e3730106e9d4f75de199e1b83cf285b8ff031968 (diff) | |
download | iced-619ba9294d5e0f7913f82838d78018fc6714d26a.tar.gz iced-619ba9294d5e0f7913f82838d78018fc6714d26a.tar.bz2 iced-619ba9294d5e0f7913f82838d78018fc6714d26a.zip |
Merge branch 'advanced-text' into incremental-rendering
Diffstat (limited to 'examples/todos')
-rw-r--r-- | examples/todos/src/main.rs | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index ed3684d3..8bc7be09 100644 --- a/examples/todos/src/main.rs +++ b/examples/todos/src/main.rs @@ -210,15 +210,12 @@ impl Application for Todos { .style(Color::from([0.5, 0.5, 0.5])) .horizontal_alignment(alignment::Horizontal::Center); - let input = text_input( - "What needs to be done?", - input_value, - Message::InputChanged, - ) - .id(INPUT_ID.clone()) - .padding(15) - .size(30) - .on_submit(Message::CreateTask); + let input = text_input("What needs to be done?", input_value) + .id(INPUT_ID.clone()) + .on_input(Message::InputChanged) + .on_submit(Message::CreateTask) + .padding(15) + .size(30); let controls = view_controls(tasks, *filter); let filtered_tasks = @@ -381,14 +378,12 @@ impl Task { .into() } TaskState::Editing => { - let text_input = text_input( - "Describe your task...", - &self.description, - TaskMessage::DescriptionEdited, - ) - .id(Self::text_input_id(i)) - .on_submit(TaskMessage::FinishEdition) - .padding(10); + let text_input = + text_input("Describe your task...", &self.description) + .id(Self::text_input_id(i)) + .on_input(TaskMessage::DescriptionEdited) + .on_submit(TaskMessage::FinishEdition) + .padding(10); row![ text_input, |