Add menu_height method to pick_list and combo_box

This commit is contained in:
GyulyVGC 2024-12-17 23:36:39 +01:00 committed by Héctor Ramón Jiménez
parent 9ef65db8c9
commit 71a4dff703
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 23 additions and 1 deletions

View file

@ -128,12 +128,14 @@ where
position: Point,
viewport: Rectangle,
target_height: f32,
menu_height: Length,
) -> overlay::Element<'a, Message, Theme, Renderer> {
overlay::Element::new(Box::new(Overlay::new(
position,
viewport,
self,
target_height,
menu_height,
)))
}
}
@ -185,6 +187,7 @@ where
viewport: Rectangle,
menu: Menu<'a, 'b, T, Message, Theme, Renderer>,
target_height: f32,
menu_height: Length,
) -> Self
where
T: Clone + ToString,
@ -215,7 +218,8 @@ where
text_shaping,
padding,
class,
});
})
.height(menu_height);
state.tree.diff(&list as &dyn Widget<_, _, _>);