Skip to content

Migrate menu dropdown from bespoke DrawingArea to quadraui::ContextMenu #319

Description

@JDonaghy

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

  1. Replace menu_dropdown_da (GTK bespoke DrawingArea) with a ContextMenu drawn during the main editor DA's paint pass
  2. Push the dropdown onto the ModalStack (already done for right-click context menus)
  3. Route keyboard events through the engine when menu_open_idx.is_some() — the engine handles Up/Down/Enter/Escape, both backends consume the result
  4. Remove Msg::MenuHighlight, Msg::OpenMenu dropdown-DA logic, and the bespoke dropdown DA setup/paint/click code

What this unblocks

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestinfrastructureBuild, CI, distributionuiUI/rendering

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions