pub struct MenuBarMenu { /* private fields */ }Expand description
One top-level item of a MenuBar and the menu it opens.
Implementations§
Source§impl MenuBarMenu
impl MenuBarMenu
Sourcepub fn new(
key: impl Into<SharedString>,
label: impl Into<SharedString>,
items: Vec<MenuItem>,
) -> Self
pub fn new( key: impl Into<SharedString>, label: impl Into<SharedString>, items: Vec<MenuItem>, ) -> Self
A top-level item label whose menu holds items. key identifies
it in MenuBar::on_action and MenuBar::on_open_change.
Sourcepub fn disabled_keys(
self,
keys: impl IntoIterator<Item = impl Into<SharedString>>,
) -> Self
pub fn disabled_keys( self, keys: impl IntoIterator<Item = impl Into<SharedString>>, ) -> Self
Items of this menu that render dimmed and cannot be chosen or focused.
Sourcepub fn is_disabled(self, v: bool) -> Self
pub fn is_disabled(self, v: bool) -> Self
A disabled top-level item renders dimmed, never opens, and is skipped by the arrow keys.
Auto Trait Implementations§
impl Freeze for MenuBarMenu
impl RefUnwindSafe for MenuBarMenu
impl Send for MenuBarMenu
impl Sync for MenuBarMenu
impl Unpin for MenuBarMenu
impl UnsafeUnpin for MenuBarMenu
impl UnwindSafe for MenuBarMenu
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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