Skip to main content

Module context_menu

Module context_menu 

Source
Expand description

Context-menu overlay widget.

Renders a floating right-click menu at the click coordinates, clamped to stay inside the visible window region. The caller is responsible for keyboard / mouse dispatch; this struct is purely a renderer.

§Layout

┌─────────────────────────┐
│ Back                    │  ← selected row (highlighted)
│ Forward                 │
│─────────────────────────│  ← separator (hairline)
│ Reload                  │
└─────────────────────────┘

Structs§

ContextMenuEntry
One entry as seen by the widget. The caller resolves label from ContextMenuItem::label() and sets is_separator / enabled.
ContextMenuOverlay
Snapshot passed to [ContextMenuOverlay::paint_at] each frame.

Constants§

CONTEXT_MENU_MIN_WIDTH
Minimum menu width in pixels.
CONTEXT_MENU_PADDING_X
Horizontal padding inside the menu panel.
CONTEXT_MENU_ROW_HEIGHT
Height of a single selectable item row in pixels.
CONTEXT_MENU_SEP_HEIGHT
Height of a separator row in pixels.