pub struct ContextMenuState { /* private fields */ }Expand description
Headless open/closed menu state + resolved item list.
Owned by the host (the GPUI Editor) mirroring PromptState: hooks
contribute items via EditorHook::context_menu_items, the host merges
with default_context_items via collect_context_items, and the
frontend only draws rows. Click position (pixels) stays in the GPUI
layer; this type never touches screen coordinates.
Implementations§
Source§impl ContextMenuState
impl ContextMenuState
Sourcepub fn items(&self) -> &[ContextMenuItem]
pub fn items(&self) -> &[ContextMenuItem]
Current item rows.
Sourcepub fn open(&mut self, items: Vec<ContextMenuItem>)
pub fn open(&mut self, items: Vec<ContextMenuItem>)
Opens the menu with a pre-merged item list.
Trait Implementations§
Source§impl Clone for ContextMenuState
impl Clone for ContextMenuState
Source§fn clone(&self) -> ContextMenuState
fn clone(&self) -> ContextMenuState
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 Debug for ContextMenuState
impl Debug for ContextMenuState
Source§impl Default for ContextMenuState
impl Default for ContextMenuState
Source§fn default() -> ContextMenuState
fn default() -> ContextMenuState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ContextMenuState
impl RefUnwindSafe for ContextMenuState
impl Send for ContextMenuState
impl Sync for ContextMenuState
impl Unpin for ContextMenuState
impl UnsafeUnpin for ContextMenuState
impl UnwindSafe for ContextMenuState
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