Make clock example responsive

This commit is contained in:
Héctor Ramón Jiménez 2022-01-15 11:56:19 +07:00
parent 75348c5b8c
commit 2f557731f3
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -66,16 +66,12 @@ impl Application for Clock {
} }
fn view(&mut self) -> Element<Message> { fn view(&mut self) -> Element<Message> {
let canvas = Canvas::new(self) let canvas = Canvas::new(self).width(Length::Fill).height(Length::Fill);
.width(Length::Units(400))
.height(Length::Units(400));
Container::new(canvas) Container::new(canvas)
.width(Length::Fill) .width(Length::Fill)
.height(Length::Fill) .height(Length::Fill)
.padding(20) .padding(20)
.center_x()
.center_y()
.into() .into()
} }
} }