Struct dioxus_desktop::tao::menu::MenuItemAttributes
pub struct MenuItemAttributes<'a> { /* private fields */ }Expand description
A custom menu item.
Implementations§
§impl<'a> MenuItemAttributes<'a>
impl<'a> MenuItemAttributes<'a>
pub fn new(title: &'a str) -> MenuItemAttributes<'a>
pub fn new(title: &'a str) -> MenuItemAttributes<'a>
Creates a new custom menu item.
title could optionally contain an & before a character to assign this character as the mnemonic
for this menu item. To display a & without assigning a mnemenonic, use &&
Platform-specific:
- macOS: mnemonics are not supported but single
&will be rmeoved anyways for consistency with other platforms.
pub fn with_id(self, id: MenuId) -> MenuItemAttributes<'a>
pub fn with_id(self, id: MenuId) -> MenuItemAttributes<'a>
Assign a custom menu id.
pub fn with_accelerators(
self,
keyboard_accelerators: &Accelerator
) -> MenuItemAttributes<'a>
pub fn with_accelerators(
self,
keyboard_accelerators: &Accelerator
) -> MenuItemAttributes<'a>
pub fn with_enabled(self, enabled: bool) -> MenuItemAttributes<'a>
pub fn with_enabled(self, enabled: bool) -> MenuItemAttributes<'a>
Assign default menu state.
pub fn with_selected(self, selected: bool) -> MenuItemAttributes<'a>
pub fn with_selected(self, selected: bool) -> MenuItemAttributes<'a>
Assign default checkbox style.
Default is false
If selected is false, renders a regular menu item.