Skip to content

toolkit: add ContextMenu right-click popup helper#14

Merged
tannevaled merged 1 commit into
mainfrom
toolkit-contextmenu
Jul 10, 2026
Merged

toolkit: add ContextMenu right-click popup helper#14
tannevaled merged 1 commit into
mainfrom
toolkit-contextmenu

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

The second pre-1.0 "model edge" item: the overlay wrapper the widget model lacked around the bare Menu.

Popup(x, y) shows a Menu at the cursor; it auto-sizes to its items (widest label + shortcut/submenu-chevron, floored at ContextMenuMinW), clamps itself inside the surface so it never spills off an edge, forwards an inside-click to the Menu (firing the row's Action and closing via OnClose), and dismisses on any outside-click. Mirrors how DropDown/DatePicker own their pop-ups.

Renders through painter.Painter. 100% coverage; go vet clean; builds on all 6 arches + js/wasm.

🤖 Generated with Claude Code

The overlay wrapper the widget model lacked around the bare Menu: Popup(x, y)
shows a Menu at the cursor, it auto-sizes to its items (widest label +
shortcut/chevron, floored), clamps itself inside the surface so it never
spills off an edge, forwards an inside-click to the Menu (firing the row's
Action and closing via OnClose), and dismisses on any outside-click. Mirrors
how DropDown/DatePicker own their pop-ups. 100% coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit b717367 into main Jul 10, 2026
1 check passed
@tannevaled
tannevaled deleted the toolkit-contextmenu branch July 10, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant