From 5fae6e59ffbc5913761df638dc7f0c35b7f43bc9 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 20 Sep 2021 14:33:02 +0700 Subject: Introduce and use `CrossAlign` enum for `Column` and `Row` --- examples/pane_grid/src/main.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'examples/pane_grid/src') diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index 5a134756..737c9126 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -1,7 +1,8 @@ use iced::{ - button, executor, keyboard, pane_grid, scrollable, Align, Application, - Button, Color, Column, Command, Container, Element, HorizontalAlignment, - Length, PaneGrid, Row, Scrollable, Settings, Subscription, Text, + button, executor, keyboard, pane_grid, scrollable, Application, Button, + Color, Column, Command, Container, CrossAlign, Element, + HorizontalAlignment, Length, PaneGrid, Row, Scrollable, Settings, + Subscription, Text, }; use iced_native::{event, subscription, Event}; @@ -329,7 +330,7 @@ impl Content { let content = Scrollable::new(scroll) .width(Length::Fill) .spacing(10) - .align_items(Align::Center) + .align_items(CrossAlign::Center) .push(controls); Container::new(content) -- cgit From a0ad3996225601aaa1ebe051cba115374b55c80e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 20 Sep 2021 15:09:55 +0700 Subject: Refactor alignment types into an `alignment` module --- examples/pane_grid/src/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'examples/pane_grid/src') diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index 737c9126..69872bad 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -1,8 +1,7 @@ use iced::{ - button, executor, keyboard, pane_grid, scrollable, Application, Button, - Color, Column, Command, Container, CrossAlign, Element, - HorizontalAlignment, Length, PaneGrid, Row, Scrollable, Settings, - Subscription, Text, + alignment, button, executor, keyboard, pane_grid, scrollable, Alignment, + Application, Button, Color, Column, Command, Container, Element, Length, + PaneGrid, Row, Scrollable, Settings, Subscription, Text, }; use iced_native::{event, subscription, Event}; @@ -293,7 +292,7 @@ impl Content { state, Text::new(label) .width(Length::Fill) - .horizontal_alignment(HorizontalAlignment::Center) + .horizontal_alignment(alignment::Horizontal::Center) .size(16), ) .width(Length::Fill) @@ -330,7 +329,7 @@ impl Content { let content = Scrollable::new(scroll) .width(Length::Fill) .spacing(10) - .align_items(CrossAlign::Center) + .align_items(Alignment::Center) .push(controls); Container::new(content) -- cgit