Introduce Widget::size_hint and fix further layout inconsistencies

This commit is contained in:
Héctor Ramón Jiménez 2024-01-05 17:24:43 +01:00
parent 0322e820eb
commit 22226394f7
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
17 changed files with 210 additions and 123 deletions

View file

@ -73,16 +73,15 @@ impl Application for Example {
}
fn view(&self) -> Element<Message> {
let downloads = Column::with_children(
self.downloads.iter().map(Download::view).collect(),
)
.push(
button("Add another download")
.on_press(Message::Add)
.padding(10),
)
.spacing(20)
.align_items(Alignment::End);
let downloads =
Column::with_children(self.downloads.iter().map(Download::view))
.push(
button("Add another download")
.on_press(Message::Add)
.padding(10),
)
.spacing(20)
.align_items(Alignment::End);
container(downloads)
.width(Length::Fill)