plat/sysmenu.rs#
Source: lib/plat/sysmenu.rs
sysmenu -- the app's menus in the system's own menu bar (macOS: between the app menu and the Window
menu, as every Mac app has them; iPadOS: between the application menu and Window as well;
docs/APPLE.md "Menüs in der Menüleiste" and AP9)
sysmenu_supported() -> bool whether this system shows an app's menus in its own bar (macOS
with a window of the app, an iPad under UIKit; elsewhere false:
the app draws its menu bar in the window)
sysmenu_window_row() -> bool whether the window keeps its own menu row as well (iPadOS: its
bar hides until a swipe down from the top or the pointer there
reveals it, the row stays the way for the finger; macOS: false)
sysmenu_set(&[SysMenuItem]) the app's menus: the top level are the menus of the bar, their
`sub` the rows; the same list again changes nothing; an empty
list takes them out again
sysmenu_take() -> Vec<u32> the ids of the rows chosen since the last call (each choice calls
wake())
A row's key equivalent is a character ("s", or a function key's: "\u{F704}" = F1) with MOD_* bits;
MOD_CTRL is the Mac's Command key, MOD_ALT its Option key. A disabled row cannot be chosen, its key
then reaches the window as a normal key press. On the iPad the rows with a key also show while
Command is held; Insert has no key there.
struct SysMenuItemone menu or rowid: u32-- reported by sysmenu_take (0: a row without action, e.g. a menu or a submenu)label: Stringflags: u32-- TI_CHECKED, TI_DISABLED, TI_SEPARATORkey: String-- the key equivalent: one character ("" = none)mods: u32-- MOD_SHIFT | MOD_CTRL | MOD_ALT of the key equivalentsub: Vec<SysMenuItem>-- a menu or submenu when not empty