pub struct IconMenuItemBuilder<'a> { /* private fields */ }Available on
desktop only.Expand description
A builder type for IconMenuItem
Implementations§
source§impl<'a> IconMenuItemBuilder<'a>
impl<'a> IconMenuItemBuilder<'a>
sourcepub fn new<S: AsRef<str>>(text: S) -> Self
pub fn new<S: AsRef<str>>(text: S) -> Self
Create a new menu item builder.
textcould 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&&.
sourcepub fn with_id<I: Into<MenuId>, S: AsRef<str>>(id: I, text: S) -> Self
pub fn with_id<I: Into<MenuId>, S: AsRef<str>>(id: I, text: S) -> Self
Create a new menu item builder with the specified id.
textcould 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&&.
sourcepub fn accelerator<S: AsRef<str>>(self, accelerator: S) -> Self
pub fn accelerator<S: AsRef<str>>(self, accelerator: S) -> Self
Set the accelerator for this menu item.
sourcepub fn icon(self, icon: Image<'a>) -> Self
pub fn icon(self, icon: Image<'a>) -> Self
Set the icon for this menu item.
Note: This method conflicts with Self::native_icon
so calling one of them, will reset the other.
sourcepub fn native_icon(self, icon: NativeIcon) -> Self
pub fn native_icon(self, icon: NativeIcon) -> Self
Set the icon for this menu item.
Note: This method conflicts with Self::icon
so calling one of them, will reset the other.
Auto Trait Implementations§
impl<'a> Freeze for IconMenuItemBuilder<'a>
impl<'a> RefUnwindSafe for IconMenuItemBuilder<'a>
impl<'a> Send for IconMenuItemBuilder<'a>
impl<'a> Sync for IconMenuItemBuilder<'a>
impl<'a> Unpin for IconMenuItemBuilder<'a>
impl<'a> UnwindSafe for IconMenuItemBuilder<'a>
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