diff options
Diffstat (limited to 'examples/todos.rs')
-rw-r--r-- | examples/todos.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/examples/todos.rs b/examples/todos.rs index 1563aad5..4166f75a 100644 --- a/examples/todos.rs +++ b/examples/todos.rs @@ -146,6 +146,7 @@ impl Application for Todos { .. }) => { let title = Text::new("todos") + .width(Length::Fill) .size(100) .color([0.5, 0.5, 0.5]) .horizontal_alignment(HorizontalAlignment::Center); @@ -284,7 +285,8 @@ impl Task { self.completed, &self.description, TaskMessage::Completed, - ); + ) + .width(Length::Fill); Row::new() .spacing(20) @@ -318,9 +320,10 @@ impl Task { .push( Button::new( delete_button, - Row::new().spacing(10).push(delete_icon()).push( - Text::new("Delete").width(Length::Shrink), - ), + Row::new() + .spacing(10) + .push(delete_icon()) + .push(Text::new("Delete")), ) .on_press(TaskMessage::Delete) .padding(10) @@ -350,7 +353,7 @@ impl Controls { let tasks_left = tasks.iter().filter(|task| !task.completed).count(); let filter_button = |state, label, filter, current_filter| { - let label = Text::new(label).size(16).width(Length::Shrink); + let label = Text::new(label).size(16); let button = Button::new(state, label).style(style::Button::Filter { selected: filter == current_filter, @@ -368,11 +371,11 @@ impl Controls { tasks_left, if tasks_left == 1 { "task" } else { "tasks" } )) + .width(Length::Fill) .size(16), ) .push( Row::new() - .width(Length::Shrink) .spacing(10) .push(filter_button( all_button, |