#[non_exhaustive]pub enum MenuBarStyle {
Macos,
Gnome,
Kde,
Windows,
}Expand description
Arrange an app’s top-level menus into the platform’s standard bar, filling every standard slot the app did not claim with the backend’s stock menu.
Which desktop’s menu-bar conventions a backend follows. A toolkit picks the style of the platform it is native to, not the one it happens to be compiled on.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Macos
macOS: an app menu, and a Window menu the toolkit installs natively.
Gnome
GNOME / GTK on Linux.
Kde
KDE Plasma / Qt on Linux.
Windows
Windows.
Implementations§
Source§impl MenuBarStyle
impl MenuBarStyle
Sourcepub fn bar_order(self) -> (&'static [MenuBarRole], &'static [MenuBarRole])
pub fn bar_order(self) -> (&'static [MenuBarRole], &'static [MenuBarRole])
The standard slots before and after the app’s own menus on this desktop.
Sourcepub fn stock(self, role: MenuBarRole) -> Option<MenuItem>
pub fn stock(self, role: MenuBarRole) -> Option<MenuItem>
This desktop’s stock menu for a slot, as a pure model: every entry is a MenuRole, so
each backend renders it with its own native command and localized label and nothing here
is toolkit- or app-specific.
File is always the app’s own. Window is None even on macOS because the toolkit
installs it natively (only AppKit can append the live window list). Settings is None
for now everywhere: Preferences is placed before a backend sees the model
(inject_preferences), so a stock Settings menu would be a second copy of it.
Trait Implementations§
Source§impl Clone for MenuBarStyle
impl Clone for MenuBarStyle
Source§fn clone(&self) -> MenuBarStyle
fn clone(&self) -> MenuBarStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MenuBarStyle
impl Debug for MenuBarStyle
Source§impl PartialEq for MenuBarStyle
impl PartialEq for MenuBarStyle
Source§fn eq(&self, other: &MenuBarStyle) -> bool
fn eq(&self, other: &MenuBarStyle) -> bool
self and other values to be equal, and is used by ==.impl Copy for MenuBarStyle
impl Eq for MenuBarStyle
impl StructuralPartialEq for MenuBarStyle
Auto Trait Implementations§
impl Freeze for MenuBarStyle
impl RefUnwindSafe for MenuBarStyle
impl Send for MenuBarStyle
impl Sync for MenuBarStyle
impl Unpin for MenuBarStyle
impl UnsafeUnpin for MenuBarStyle
impl UnwindSafe for MenuBarStyle
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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