pub struct MenuEntry { /* private fields */ }Expand description
A menu entry under construction. Build a command with menu_item, a nested submenu with
sub_menu, a standard system command with menu_role, and a divider with menu_separator.
Attach to a Piece via [Decorate::context_menu] or install app-wide via app_menu.
Implementations§
Source§impl MenuEntry
impl MenuEntry
Source§impl MenuEntry
Claim one of the platform’s standard menu-bar slots for this submenu: the backend places it
where that menu belongs and does NOT add its own stock version. Without a role, a submenu is
an app menu and sits between the standard ones.
impl MenuEntry
Claim one of the platform’s standard menu-bar slots for this submenu: the backend places it where that menu belongs and does NOT add its own stock version. Without a role, a submenu is an app menu and sits between the standard ones.
ⓘ
sub_menu(tr("menu-file"), vec![…]).bar_role(MenuBarRole::File)pub fn bar_role(self, role: MenuBarRole) -> MenuEntry
Auto Trait Implementations§
impl Freeze for MenuEntry
impl !RefUnwindSafe for MenuEntry
impl !Send for MenuEntry
impl !Sync for MenuEntry
impl Unpin for MenuEntry
impl UnsafeUnpin for MenuEntry
impl !UnwindSafe for MenuEntry
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more