pub enum MenuItem {
Action {
id: u64,
label: String,
shortcut: Option<Shortcut>,
enabled: bool,
role: Option<MenuRole>,
},
Submenu {
label: String,
items: Vec<MenuItem>,
role: Option<MenuBarRole>,
},
Separator,
}Expand description
One entry in a menu (recursive — a Submenu nests).
Variants§
Action
A command. id (nonzero) dispatches Event::MenuAction to the app; a role-only item uses
the native standard command instead (id 0). label/shortcut override the role’s defaults.
A nested submenu. At the TOP level of an app menu a role claims one of the platform’s
standard menu-bar slots: the backend then uses this menu instead of its stock one, and
places it where the platform expects that menu to sit.
Separator
A visual separator.
Trait Implementations§
impl StructuralPartialEq for MenuItem
Auto Trait Implementations§
impl Freeze for MenuItem
impl RefUnwindSafe for MenuItem
impl Send for MenuItem
impl Sync for MenuItem
impl Unpin for MenuItem
impl UnsafeUnpin for MenuItem
impl UnwindSafe for MenuItem
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