pub struct Menu {
pub min_width: f32,
pub row_height: f32,
pub font_size: Option<f32>,
pub radius: f32,
/* private fields */
}Expand description
A vertical list of pressable rows — the standard dropdown content.
Pair with OverlayApi::dropdown, which anchors it below the trigger:
ⓘ
Button::new("File")
.dropdown(open.clone(), move || Box::new(
Menu::new()
.item("New", { let o = open.clone(); move || { o.set(false); /* … */ } })
.item("Open", { let o = open.clone(); move || { o.set(false); /* … */ } })
))Fields§
§min_width: f32§row_height: f32§font_size: Option<f32>None = read from the active theme’s typography.body_medium
(D127 “environment” track — see Checkbox::resolved_font_size’s doc
for the reasoning).
radius: f32Implementations§
Trait Implementations§
Source§impl Widget for Menu
impl Widget for Menu
Source§fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
Measure under
ctx.constraints and return a size within them. Read moreSource§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Declare this widget’s children. Drives every default below.
Source§fn flex_factor(&self) -> f32
fn flex_factor(&self) -> f32
Flex weight inside Row/Column. Wrappers are transparent by default.
Auto Trait Implementations§
impl !RefUnwindSafe for Menu
impl !UnwindSafe for Menu
impl Freeze for Menu
impl Send for Menu
impl Sync for Menu
impl Unpin for Menu
impl UnsafeUnpin for Menu
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<W> FocusApi for W
impl<W> FocusApi for W
Source§fn focus_node(self, node: FocusNode) -> WithFocus<Self>
fn focus_node(self, node: FocusNode) -> WithFocus<Self>
Attach a focus node. This enables focus-ring rendering and explicit
neighbor wiring.