Skip to content

lib/ui: no menu-bar widget — desktop-app shells must hand-roll one from buttons + show_menu #565

Description

@InauguralPhysicist

Found by DeslanStudio milestone 4b porting the studio's QMenuBar (File/Edit/View/Help with shortcut-labelled items).

The toolkit has the pull-down half (menu with [label, shortcut] items, separators, show_menu, click-away close via _close_menus) but no menu BAR: the consumer builds a toolbar of title buttons whose on_click calls show_menu of [m, btn._ax, bar_bottom], and must (a) position menus from cached _ax (valid only after a _layout pass), (b) add every menu widget LAST to the root's children so it renders above the content it overlaps, and (c) keep title-button and menu lists paired by hand.

Suggestion: a menu_bar(id, x, y, w, menus) widget — menus a list of {"title", "items", "on_select"} — that owns the title strip, popup positioning, z-order (render its open menu after children, like dropdown does), and open/close state.

Downstream reference implementation to steal from: DeslanStudio src/client/shell.eigs (_shell_build_menubar).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions