Skip to main content
← rust.krizaka.comkrizaka.com

Module menu

Module menu 

Source
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§

MenuGroupSpec
MenuItemSpec
MenuSpec
StandardLabels
The labels of the menus macOS expects, in the page’s language.

Enums§

MenuError
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 acceleratorOf writes it: modifiers, then one key (CmdOrCtrl+Shift+K, CmdOrCtrl+,, CmdOrCtrl+1).