pub struct ContextMenuItem {
pub id: String,
pub label: String,
pub shortcut: Option<KeyboardShortcut>,
pub enabled: bool,
pub separator_after: bool,
pub icon: Option<String>,
}Expand description
A single item in a context menu
Represents a menu item with optional shortcuts, icons, and visual separators. Items can be enabled or disabled to control user interaction.
Fields§
§id: StringUnique identifier for the item
label: StringDisplay label
shortcut: Option<KeyboardShortcut>Optional keyboard shortcut hint
enabled: boolWhether the item is enabled
separator_after: boolWhether to show a separator after this item
icon: Option<String>Optional icon identifier
Implementations§
Source§impl ContextMenuItem
impl ContextMenuItem
Sourcepub fn with_shortcut(self, shortcut: KeyboardShortcut) -> Self
pub fn with_shortcut(self, shortcut: KeyboardShortcut) -> Self
Sourcepub fn with_separator(self) -> Self
pub fn with_separator(self) -> Self
Sourcepub fn is_separator(&self) -> bool
pub fn is_separator(&self) -> bool
Check if this is a separator-only item
Trait Implementations§
Source§impl Clone for ContextMenuItem
impl Clone for ContextMenuItem
Source§fn clone(&self) -> ContextMenuItem
fn clone(&self) -> ContextMenuItem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ContextMenuItem
impl RefUnwindSafe for ContextMenuItem
impl Send for ContextMenuItem
impl Sync for ContextMenuItem
impl Unpin for ContextMenuItem
impl UnsafeUnpin for ContextMenuItem
impl UnwindSafe for ContextMenuItem
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