summaryrefslogtreecommitdiffstats
path: root/examples/todos
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-09-20 15:09:55 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-09-20 15:14:08 +0700
commita0ad3996225601aaa1ebe051cba115374b55c80e (patch)
tree8420a91cd319a63b1ed257a6334453a1a673bdfb /examples/todos
parent5fae6e59ffbc5913761df638dc7f0c35b7f43bc9 (diff)
downloadiced-a0ad3996225601aaa1ebe051cba115374b55c80e.tar.gz
iced-a0ad3996225601aaa1ebe051cba115374b55c80e.tar.bz2
iced-a0ad3996225601aaa1ebe051cba115374b55c80e.zip
Refactor alignment types into an `alignment` module
Diffstat (limited to 'examples/todos')
-rw-r--r--examples/todos/src/main.rs23
1 files changed, 13 insertions, 10 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index 6e798f32..11f23fd4 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -1,7 +1,10 @@
+use iced::alignment::{self, Alignment};
+use iced::button::{self, Button};
+use iced::scrollable::{self, Scrollable};
+use iced::text_input::{self, TextInput};
use iced::{
- button, scrollable, text_input, Application, Button, Checkbox, Column,
- Command, Container, CrossAlign, Element, Font, HorizontalAlignment, Length,
- Row, Scrollable, Settings, Text, TextInput,
+ Application, Checkbox, Column, Command, Container, Element, Font, Length,
+ Row, Settings, Text,
};
use serde::{Deserialize, Serialize};
@@ -151,7 +154,7 @@ impl Application for Todos {
.width(Length::Fill)
.size(100)
.color([0.5, 0.5, 0.5])
- .horizontal_alignment(HorizontalAlignment::Center);
+ .horizontal_alignment(alignment::Horizontal::Center);
let input = TextInput::new(
input,
@@ -295,7 +298,7 @@ impl Task {
Row::new()
.spacing(20)
- .align_items(CrossAlign::Center)
+ .align_items(Alignment::Center)
.push(checkbox)
.push(
Button::new(edit_button, edit_icon())
@@ -320,7 +323,7 @@ impl Task {
Row::new()
.spacing(20)
- .align_items(CrossAlign::Center)
+ .align_items(Alignment::Center)
.push(text_input)
.push(
Button::new(
@@ -369,7 +372,7 @@ impl Controls {
Row::new()
.spacing(20)
- .align_items(CrossAlign::Center)
+ .align_items(Alignment::Center)
.push(
Text::new(&format!(
"{} {} left",
@@ -431,7 +434,7 @@ impl Filter {
fn loading_message<'a>() -> Element<'a, Message> {
Container::new(
Text::new("Loading...")
- .horizontal_alignment(HorizontalAlignment::Center)
+ .horizontal_alignment(alignment::Horizontal::Center)
.size(50),
)
.width(Length::Fill)
@@ -445,7 +448,7 @@ fn empty_message<'a>(message: &str) -> Element<'a, Message> {
Text::new(message)
.width(Length::Fill)
.size(25)
- .horizontal_alignment(HorizontalAlignment::Center)
+ .horizontal_alignment(alignment::Horizontal::Center)
.color([0.7, 0.7, 0.7]),
)
.width(Length::Fill)
@@ -464,7 +467,7 @@ fn icon(unicode: char) -> Text {
Text::new(&unicode.to_string())
.font(ICONS)
.width(Length::Units(20))
- .horizontal_alignment(HorizontalAlignment::Center)
+ .horizontal_alignment(alignment::Horizontal::Center)
.size(20)
}