Skip to main content

Module menus

Module menus 

Source
Expand description

Menus are declared, never drawn by whoever fills them: a menu is an id (app.main, panel.tab) to which the shell, a panel or a plugin contributes items. An item names a command (its title and keys come from the command and the keymap, so a menu never shows a key that does not work), a submenu, or a list the application fills when the menu opens (the themes, the recent files). Items sit in groups, separated when shown, and in an order within their group; a when clause hides or greys an item, a checked clause ticks it. A radio item (MenuItem::radio) is one choice of a group: its checked clause says whether it is the chosen one, shown with a dot instead of a tick.

Structs§

MenuItem
One contribution to a menu.
Menus
The menu contributions, each owned.

Enums§

Item
What an item is.
Shown
An item as a menu shows it in a context.

Functions§

show_items
The items of one menu in a context: groups in order, separated, items hidden or greyed by their when.
sort_items
Sorts items as menus show them: by group, then order.