Skip to content

feat(#196): a main menu bar takes its row from the free area - #197

Merged
octalide merged 1 commit into
devfrom
feat/196
Oct 1, 2026
Merged

octalide merged 1 commit into
devfrom
feat/196

Conversation

@octalide

@octalide octalide commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Closes #196

Plan

  • menu.begin_main_bar(ctx, key) Menu takes one control row (the menu_title row height) off the top of the free area with context.carve, as dock.begin_dock takes its strip. context.free_area read after it starts below the bar, so a dock space placed from it lies beneath. Closed by the existing end_bar.
  • begin_bar and begin_main_bar differ only in where the row comes from (widget.place versus context.carve). Both call one private bar_in(ctx, key, r) holding the old body of begin_bar, so headers, menus, shortcuts, keyboard navigation and painting are shared, not duplicated.
  • Like begin_dock, it is called at the root, outside surfaces and bands. It paints in the base band like any bar, and its menus are popups above everything.
  • Docs: the module header, KIND_BAR, end_bar, context.free_area and the README menu section.
  • Test: menu__main_bar_takes_its_row_from_the_free_area lays out a main bar, then a dock space from free_area with a window docked over it. It checks the free area starts at the bar's bottom, the docked window's content lies below the bar, the header is what is under the cursor there, and a press on it opens its menu over the space.

Ran: mach test . --filter menu__, mach build . -p release, mach fmt --check on the root and both demos, and the gallery and panel demo tests after mach dep pull. Goldens unchanged.

menu.begin_main_bar carves one control row off the top of the free area
with context.carve, as a docked container takes its strip, so free_area
read after it starts below the bar and a dock space placed from it lies
beneath. begin_bar and begin_main_bar share one bar_in over the row each
takes, so headers, shortcuts, keyboard navigation and painting are the
same, closed by the same end_bar.
@octalide
octalide marked this pull request as ready for review October 1, 2026 17:24
@octalide
octalide merged commit dd5fb65 into dev Oct 1, 2026
2 checks passed
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.

feat: a main menu bar takes its row from the free area

1 participant