diff options
| author | 2023-04-17 23:41:12 +0200 | |
|---|---|---|
| committer | 2023-04-17 23:41:12 +0200 | |
| commit | 4bae457c37b499f3cfddbdac9ff37a34cbce61d5 (patch) | |
| tree | 79af93b2f7fabca1687900b48b165c5c74dcd26f /examples/todos | |
| parent | c0431aedd3bbef4161456f2fa5f29866e8f17fc5 (diff) | |
| parent | 4b05f42fd6d18bf572b772dd60d6a4309ea5f343 (diff) | |
| download | iced-4bae457c37b499f3cfddbdac9ff37a34cbce61d5.tar.gz iced-4bae457c37b499f3cfddbdac9ff37a34cbce61d5.tar.bz2 iced-4bae457c37b499f3cfddbdac9ff37a34cbce61d5.zip | |
Merge branch 'master' into advanced-text
Diffstat (limited to '')
| -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