From 0240c3981b716c82ecb3364945815335b420a63e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 10 Nov 2019 06:05:20 +0100 Subject: Draft custom layout engine based on `druid` --- examples/todos.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/todos.rs') diff --git a/examples/todos.rs b/examples/todos.rs index 5257fc12..4caad949 100644 --- a/examples/todos.rs +++ b/examples/todos.rs @@ -1,6 +1,6 @@ use iced::{ scrollable, text::HorizontalAlignment, text_input, Align, Application, - Checkbox, Color, Column, Element, Length, Scrollable, Text, TextInput, + Checkbox, Color, Column, Element, Scrollable, Text, TextInput, }; pub fn main() { @@ -77,7 +77,7 @@ impl Application for Todos { ); let content = Column::new() - .max_width(Length::Units(800)) + .max_width(800) .align_self(Align::Center) .spacing(20) .push(title) -- cgit From ceb02f4a36769c488c2525db2fb73f092a6c2706 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 11 Nov 2019 05:26:08 +0100 Subject: Implement `Container` widget Remove `align_self` and `justify_content` methods --- examples/todos.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples/todos.rs') diff --git a/examples/todos.rs b/examples/todos.rs index 4caad949..7f37300b 100644 --- a/examples/todos.rs +++ b/examples/todos.rs @@ -1,6 +1,6 @@ use iced::{ - scrollable, text::HorizontalAlignment, text_input, Align, Application, - Checkbox, Color, Column, Element, Scrollable, Text, TextInput, + scrollable, text::HorizontalAlignment, text_input, Application, Checkbox, + Color, Column, Container, Element, Length, Scrollable, Text, TextInput, }; pub fn main() { @@ -78,7 +78,6 @@ impl Application for Todos { let content = Column::new() .max_width(800) - .align_self(Align::Center) .spacing(20) .push(title) .push(input) @@ -86,7 +85,7 @@ impl Application for Todos { Scrollable::new(&mut self.scroll) .padding(40) - .push(content) + .push(Container::new(content).width(Length::Fill).center_x()) .into() } } -- cgit