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, context-item-detail.
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.
Sourcepub fn detail(self, text: impl Into<String>) -> Self
pub fn detail(self, text: impl Into<String>) -> Self
A faint note on the right of the row, before the shortcut or the submenu arrow when there is
one, e.g. why the entry cannot be used: "bsdtar needed". It is plain text in the quiet
tone, drawn on disabled rows too. The menu widens to fit it, and where the menu has no room
the note is cut before the label is.
Trait Implementations§
Source§impl<Msg: Clone> Clone for ContextItem<Msg>
impl<Msg: Clone> Clone for ContextItem<Msg>
Source§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