Expand description
The native menu bar, described by the page (krizaka-ui ADR-002: « desktop is the web in a window »).
The page owns the words (its messages, in the person’s language) and the shortcuts (the same map useShortcuts
answers, turned into accelerators with acceleratorOf of @krizaka/ui). It sends a MenuSpec; the kit checks it
here, then builds the macOS menu: the app menu (about, hide, quit), the Edit menu (without it ⌘C and ⌘V do nothing
in a text field), the product’s menus, the Window menu. A click on a product item is sent back to the page by its id.
Structs§
- Menu
Group Spec - Menu
Item Spec - Menu
Spec - Standard
Labels - The labels of the menus macOS expects, in the page’s language.
Enums§
- Menu
Error - What the page sent that the menu refuses. Standard labels are named by their field; anything else the page wrote (an id, a title, a shortcut) is never repeated.
Constants§
- MAX_
ITEMS - MAX_
LABEL - MAX_
MENUS - RESERVED
- The shortcuts macOS gives to the standard menus (quit, hide, minimise, close, the Edit menu): never a product’s.
Functions§
- check_
accelerator - An accelerator as
acceleratorOfwrites it: modifiers, then one key (CmdOrCtrl+Shift+K,CmdOrCtrl+,,CmdOrCtrl+1).