pub struct MaterialMenuItem { /* private fields */ }Expand description
One menu item.
Implementations§
Source§impl MaterialMenuItem
impl MaterialMenuItem
pub fn new(label: impl Into<SharedString>) -> Self
pub fn supporting_text(self, text: impl Into<SharedString>) -> Self
Sourcepub fn leading(self, icon: impl IntoElement) -> Self
pub fn leading(self, icon: impl IntoElement) -> Self
A leading icon (20dp Expressive, 24dp baseline).
Sourcepub fn trailing_text(self, text: impl Into<SharedString>) -> Self
pub fn trailing_text(self, text: impl Into<SharedString>) -> Self
Trailing text such as a keyboard shortcut (supplied by the caller).
Show the sub-menu indicator; the item’s activation opens the sub-menu.
pub fn selected(self, selected: bool) -> Self
pub fn disabled(self, disabled: bool) -> Self
Sourcepub fn preview_state(self, state: InteractionPreview) -> Self
pub fn preview_state(self, state: InteractionPreview) -> Self
Render a static specimen in one forced interaction state.
pub fn on_click( self, handler: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, ) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for MaterialMenuItem
impl !Send for MaterialMenuItem
impl !Sync for MaterialMenuItem
impl !UnwindSafe for MaterialMenuItem
impl Freeze for MaterialMenuItem
impl Unpin for MaterialMenuItem
impl UnsafeUnpin for MaterialMenuItem
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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