Replace width and height with Widget::size

This commit is contained in:
Héctor Ramón Jiménez 2024-01-05 17:46:33 +01:00
parent 22226394f7
commit d278bfd21d
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
42 changed files with 212 additions and 275 deletions

View file

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

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(