toplevel_layout: Make size depend on axis

This commit is contained in:
Ian Douglas Scott 2025-02-06 13:45:22 -08:00
parent eb69aba7b2
commit 1342e37ad6

View file

@ -21,10 +21,15 @@ impl RowColToplevelLayout {
impl ToplevelLayout for RowColToplevelLayout {
fn size(&self) -> Size<Length> {
Size {
width: Length::Fill,
// TODO Make depend on orientation or drop that option
height: Length::Shrink,
match self.axis {
Axis::Horizontal => Size {
width: Length::Fill,
height: Length::Shrink,
},
Axis::Vertical => Size {
width: Length::Shrink,
height: Length::Fill,
},
}
}