summaryrefslogtreecommitdiffstats
path: root/examples/todos.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2019-11-14 06:46:50 +0100
committerLibravatar GitHub <noreply@github.com>2019-11-14 06:46:50 +0100
commitbc8d347736ec997ec0e0c401289e2bc09e212b8a (patch)
treeb98798c09a3aa914b7d0869fba0cfd3efff7754f /examples/todos.rs
parent839e039dbf2fb89dcb8c141503740777d2af2eb3 (diff)
parent73f3c900071f950ea914652ca3f0002c1e173f61 (diff)
downloadiced-bc8d347736ec997ec0e0c401289e2bc09e212b8a.tar.gz
iced-bc8d347736ec997ec0e0c401289e2bc09e212b8a.tar.bz2
iced-bc8d347736ec997ec0e0c401289e2bc09e212b8a.zip
Merge pull request #52 from hecrj/custom-layout-engine
Custom layout engine
Diffstat (limited to 'examples/todos.rs')
-rw-r--r--examples/todos.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/todos.rs b/examples/todos.rs
index 5257fc12..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, Length, Scrollable, Text, TextInput,
+ scrollable, text::HorizontalAlignment, text_input, Application, Checkbox,
+ Color, Column, Container, Element, Length, Scrollable, Text, TextInput,
};
pub fn main() {
@@ -77,8 +77,7 @@ impl Application for Todos {
);
let content = Column::new()
- .max_width(Length::Units(800))
- .align_self(Align::Center)
+ .max_width(800)
.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()
}
}