pub struct MenuItem {
pub label: String,
pub action: ContextMenuAction,
pub payload: Option<String>,
pub shortcut_label: Option<String>,
pub disabled: bool,
/* private fields */
}Fields§
§label: String§action: ContextMenuAction§payload: Option<String>§shortcut_label: Option<String>§disabled: boolImplementations§
Source§impl MenuItem
impl MenuItem
pub fn new(label: impl Into<String>, action: ContextMenuAction) -> Self
pub fn separator() -> Self
pub fn payload(&self, value: impl Into<String>) -> Self
pub fn shortcut_label(&self, value: impl Into<String>) -> Self
pub fn disabled(&self, flag: bool) -> Self
pub fn target<T: Node>(&self, target: &T) -> Self
pub fn with_selection_range(&self, start: u32, end: u32) -> Self
pub fn focus_target_after_action(&self, flag: bool) -> Self
pub fn on_invoke(&self, callback: impl Fn() + 'static) -> Self
pub fn is_separator(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MenuItem
impl !Send for MenuItem
impl !Sync for MenuItem
impl !UnwindSafe for MenuItem
impl Freeze for MenuItem
impl Unpin for MenuItem
impl UnsafeUnpin for MenuItem
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