summaryrefslogtreecommitdiffstats
path: root/examples/todos
diff options
context:
space:
mode:
authorLibravatar gigas002 <gigas002@pm.me>2024-05-08 19:16:06 +0900
committerLibravatar gigas002 <gigas002@pm.me>2024-05-08 19:16:06 +0900
commit477887b3870aa5fbdab96c3a06f3b930462d7842 (patch)
tree2b3272bb178f8757169511966589fe6a106733f4 /examples/todos
parent0ebe0629cef37aee5c48b9409fc36618a3a3e60d (diff)
parente07b42ac96b8d098a883c93afe828a439f479c7b (diff)
downloadiced-477887b3870aa5fbdab96c3a06f3b930462d7842.tar.gz
iced-477887b3870aa5fbdab96c3a06f3b930462d7842.tar.bz2
iced-477887b3870aa5fbdab96c3a06f3b930462d7842.zip
Merge branch 'master' of https://github.com/iced-rs/iced into iced-rs-master
Diffstat (limited to 'examples/todos')
-rw-r--r--examples/todos/src/main.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index 7768c1d5..8119bc91 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -1,8 +1,8 @@
use iced::alignment::{self, Alignment};
use iced::keyboard;
use iced::widget::{
- self, button, checkbox, column, container, keyed_column, row, scrollable,
- text, text_input, Text,
+ self, button, center, checkbox, column, container, keyed_column, row,
+ scrollable, text, text_input, Text,
};
use iced::window;
use iced::{Command, Element, Font, Length, Subscription};
@@ -238,7 +238,7 @@ impl Todos {
.spacing(20)
.max_width(800);
- scrollable(container(content).padding(40).center_x()).into()
+ scrollable(container(content).center_x().padding(40)).into()
}
}
}
@@ -435,19 +435,16 @@ impl Filter {
}
fn loading_message<'a>() -> Element<'a, Message> {
- container(
+ center(
text("Loading...")
.horizontal_alignment(alignment::Horizontal::Center)
.size(50),
)
- .width(Length::Fill)
- .height(Length::Fill)
- .center_y()
.into()
}
fn empty_message(message: &str) -> Element<'_, Message> {
- container(
+ center(
text(message)
.width(Length::Fill)
.size(25)
@@ -455,7 +452,6 @@ fn empty_message(message: &str) -> Element<'_, Message> {
.color([0.7, 0.7, 0.7]),
)
.height(200)
- .center_y()
.into()
}