pub struct MenuItem {
pub label: String,
pub enabled: bool,
pub check: MenuItemCheck,
pub shortcut: Option<MenuShortcut>,
pub icon: Option<IconImage>,
}Expand description
An item of the app’s: what it shows, and whether it can be chosen.
Fields§
§label: String§enabled: bool§check: MenuItemCheck§shortcut: Option<MenuShortcut>The keys that choose it, which the menu shows beside its label.
icon: Option<IconImage>Implementations§
Source§impl MenuItem
impl MenuItem
Sourcepub fn new(label: impl Into<String>) -> MenuItem
pub fn new(label: impl Into<String>) -> MenuItem
An item labelled label that can be chosen, with no check, shortcut or icon.
pub fn enabled(self, enabled: bool) -> MenuItem
pub fn check(self, check: MenuItemCheck) -> MenuItem
pub fn shortcut(self, shortcut: MenuShortcut) -> MenuItem
pub fn icon(self, icon: IconImage) -> MenuItem
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