pub struct MenuItem<A = ContextMenuAction> {
pub label: String,
pub shortcut: Option<KeyboardShortcut>,
pub icon: Option<&'static Icon>,
pub action: A,
pub enabled: bool,
pub danger: bool,
}Expand description
One row of a context menu, generic over the action it resolves to.
The chart, series and drawing menus all build their rows from this type.
Fields§
§label: StringText displayed by the component.
shortcut: Option<KeyboardShortcut>Shown right-aligned, formatted for the platform with [Context::format_shortcut].
icon: Option<&'static Icon>Glyph displayed by the component.
action: AAction returned when this entry is activated.
enabled: boolWhether the entry can be activated.
danger: boolDestructive rows paint in the theme’s danger colours.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for MenuItem<A>where
A: Freeze,
impl<A> RefUnwindSafe for MenuItem<A>where
A: RefUnwindSafe,
impl<A> Send for MenuItem<A>where
A: Send,
impl<A> Sync for MenuItem<A>where
A: Sync,
impl<A> Unpin for MenuItem<A>where
A: Unpin,
impl<A> UnsafeUnpin for MenuItem<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for MenuItem<A>where
A: UnwindSafe,
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
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> ⓘ
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