Module context_menu
Expand description
ContextMenu primitive — a right-click / long-press invoked list of
actions with optional separators. Standalone owners draw it in their
overlay pass. open_anchored opts into measured, viewport-bounded geometry;
legacy open_at callers retain their point placement and fixed rows.
Callers push MenuItem::action(label, fn) and optional
MenuItem::separator() entries, then call open_at on right-click.
Structs§
- Context
Menu - Menu
Button - A button that opens a menu anchored to its own rect
(
crate::widget::Button::with_menu): a header’s More button, a toolbar’s sort menu. The menu opens under the button, lines up with whichever of its edges keeps it in the window, and flips above near the bottom; Enter, Space or a click opens it, and the button reads as expanded while it is open.
Enums§
- Menu
Item - Separators are purely visual and ignored by
ContextMenu::click_item.
Type Aliases§
- Menu
Action - What a menu row runs. Menus live on the UI thread with the widgets that
open them, so a row takes the toolkit’s usual single-threaded callback:
it may capture
Rcstate like anyButton::on_click.