diff options
| author | 2024-05-23 13:29:45 +0200 | |
|---|---|---|
| committer | 2024-05-23 13:29:45 +0200 | |
| commit | d8ba6b0673a33724a177f3a1ba59705527280142 (patch) | |
| tree | 89482c8d1e3a03e00b3a8151abbb81e30ae5898c /examples/todos | |
| parent | 72ed8bcc8def9956e25f3720a3095fc96bb2eef0 (diff) | |
| parent | 468794d918eb06c1dbebb33c32b10017ad335f05 (diff) | |
| download | iced-d8ba6b0673a33724a177f3a1ba59705527280142.tar.gz iced-d8ba6b0673a33724a177f3a1ba59705527280142.tar.bz2 iced-d8ba6b0673a33724a177f3a1ba59705527280142.zip | |
Merge branch 'master' into feat/text-macro
Diffstat (limited to 'examples/todos')
| -rw-r--r-- | examples/todos/src/main.rs | 17 | 
1 files changed, 8 insertions, 9 deletions
| diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index f5fb94c9..dd1e5213 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,10 @@ impl Todos {                      .spacing(20)                      .max_width(800); -                scrollable(container(content).padding(40).center_x()).into() +                scrollable( +                    container(content).center_x(Length::Fill).padding(40), +                ) +                .into()              }          }      } @@ -435,19 +438,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 +455,6 @@ fn empty_message(message: &str) -> Element<'_, Message> {              .color([0.7, 0.7, 0.7]),      )      .height(200) -    .center_y()      .into()  } | 
