summaryrefslogtreecommitdiffstats
path: root/examples/todos/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/todos/src/main.rs')
-rw-r--r--examples/todos/src/main.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index 8119bc91..c21e1a96 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -5,7 +5,7 @@ use iced::widget::{
scrollable, text, text_input, Text,
};
use iced::window;
-use iced::{Command, Element, Font, Length, Subscription};
+use iced::{Element, Font, Length, Subscription, Task as Command};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
@@ -238,7 +238,10 @@ impl Todos {
.spacing(20)
.max_width(800);
- scrollable(container(content).center_x().padding(40)).into()
+ scrollable(
+ container(content).center_x(Length::Fill).padding(40),
+ )
+ .into()
}
}
}
@@ -396,10 +399,10 @@ fn view_controls(tasks: &[Task], current_filter: Filter) -> Element<Message> {
};
row![
- text(format!(
+ text!(
"{tasks_left} {} left",
if tasks_left == 1 { "task" } else { "tasks" }
- ))
+ )
.width(Length::Fill),
row![
filter_button("All", Filter::All, current_filter),