pub struct ContextItem<Msg> { /* private fields */ }Expand description
One row of a menu: an action, a submenu or a gap between groups.
Style keys: context-menu (bg), context-item with hover and disabled,
context-item.danger, context-item-shortcut, context-item-chevron.
Implementations§
Source§impl<Msg> ContextItem<Msg>
impl<Msg> ContextItem<Msg>
Sourcepub fn new(label: impl Into<String>, message: Msg) -> Self
pub fn new(label: impl Into<String>, message: Msg) -> Self
An action labelled label that sends message when chosen.
A row that opens items beside the menu.
Sourcepub fn shortcut(self, label: impl Into<String>) -> Self
pub fn shortcut(self, label: impl Into<String>) -> Self
Faint key label kept at the right edge, e.g. "ctrl r". It only describes the key; bind
the key itself in the keymap.
Trait Implementations§
Source§impl<Msg: Clone> Clone for ContextItem<Msg>
impl<Msg: Clone> Clone for ContextItem<Msg>
Source§fn clone(&self) -> ContextItem<Msg>
fn clone(&self) -> ContextItem<Msg>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Msg: Debug> Debug for ContextItem<Msg>
impl<Msg: Debug> Debug for ContextItem<Msg>
impl<Msg: Eq> Eq for ContextItem<Msg>
Source§impl<Msg: PartialEq> PartialEq for ContextItem<Msg>
impl<Msg: PartialEq> PartialEq for ContextItem<Msg>
impl<Msg: PartialEq> StructuralPartialEq for ContextItem<Msg>
Auto Trait Implementations§
impl<Msg> Freeze for ContextItem<Msg>
impl<Msg> RefUnwindSafe for ContextItem<Msg>
impl<Msg> Send for ContextItem<Msg>
impl<Msg> Sync for ContextItem<Msg>
impl<Msg> Unpin for ContextItem<Msg>
impl<Msg> UnsafeUnpin for ContextItem<Msg>
impl<Msg> UnwindSafe for ContextItem<Msg>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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