Merge pull request #2192 from iced-rs/fix/layout-inconsistencies

Layout consistency
This commit is contained in:
Héctor Ramón 2024-01-12 14:41:40 +01:00 committed by GitHub
commit 50c310fd9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 1310 additions and 788 deletions

View file

@ -244,12 +244,15 @@ where
self.rebuild_element_if_necessary();
}
fn width(&self) -> Length {
self.with_element(|element| element.as_widget().width())
fn size(&self) -> Size<Length> {
self.with_element(|element| element.as_widget().size())
}
fn height(&self) -> Length {
self.with_element(|element| element.as_widget().height())
fn size_hint(&self) -> Size<Length> {
Size {
width: Length::Shrink,
height: Length::Shrink,
}
}
fn layout(

View file

@ -135,12 +135,11 @@ where
})
}
fn width(&self) -> Length {
Length::Fill
}
fn height(&self) -> Length {
Length::Fill
fn size(&self) -> Size<Length> {
Size {
width: Length::Fill,
height: Length::Fill,
}
}
fn layout(