Summary
The menu bar labels were migrated to quadraui::MenuBar in #301, but the dropdown overlay is still a bespoke menu_dropdown_da DrawingArea with hand-rolled rendering and event routing. This blocks keyboard navigation (#308 item 1) because key events fight with GTK's redraw cycle.
The quadraui way
The quadraui/examples/common/menu_bar_app.rs example demonstrates the correct pattern:
- Dropdown rendered via
backend.draw_context_menu(&ctx_menu, &layout) — the same ContextMenu primitive used for right-click menus
- Keyboard nav (arrows, Enter, Esc) handled in
AppLogic::handle() — no per-backend key interception
- Hover-to-switch and dropdown item highlighting handled via
ContextMenuLayout::hit_test
- Dropdown anchored below the menu bar item via
ContextMenuPlacement::Below
What needs to change
- Replace
menu_dropdown_da (GTK bespoke DrawingArea) with a ContextMenu drawn during the main editor DA's paint pass
- Push the dropdown onto the
ModalStack (already done for right-click context menus)
- Route keyboard events through the engine when
menu_open_idx.is_some() — the engine handles Up/Down/Enter/Escape, both backends consume the result
- Remove
Msg::MenuHighlight, Msg::OpenMenu dropdown-DA logic, and the bespoke dropdown DA setup/paint/click code
What this unblocks
References
Summary
The menu bar labels were migrated to
quadraui::MenuBarin #301, but the dropdown overlay is still a bespokemenu_dropdown_daDrawingArea with hand-rolled rendering and event routing. This blocks keyboard navigation (#308 item 1) because key events fight with GTK's redraw cycle.The quadraui way
The
quadraui/examples/common/menu_bar_app.rsexample demonstrates the correct pattern:backend.draw_context_menu(&ctx_menu, &layout)— the sameContextMenuprimitive used for right-click menusAppLogic::handle()— no per-backend key interceptionContextMenuLayout::hit_testContextMenuPlacement::BelowWhat needs to change
menu_dropdown_da(GTK bespoke DrawingArea) with aContextMenudrawn during the main editor DA's paint passModalStack(already done for right-click context menus)menu_open_idx.is_some()— the engine handles Up/Down/Enter/Escape, both backends consume the resultMsg::MenuHighlight,Msg::OpenMenudropdown-DA logic, and the bespoke dropdown DA setup/paint/click codeWhat this unblocks
References
quadraui/examples/common/menu_bar_app.rs— reference implementation