refactor: Improve accessibility of menus (#15302)

* refactor: improve menubar keyboard accessibility

* fix: create a temporary widget for tray icon context menu

* fix: focus menu bar with Alt when autohide is off

* fix: make menu bar focus work more like the native menus

* fix: only focus menu bar if it's not already focused

* fix: track accelerator registration to avoid duplicates

* docs: add docs for & notation in app menu item names

* fix: only try to activate accelerator if it's registered

* fix: add friend to monitor window focus change

* style: add <memory> include
This commit is contained in:
Heilig Benedek 2018-10-29 19:08:47 +01:00 committed by Charles Kerr
parent 00daff6ac8
commit 894ae1b3f5
13 changed files with 405 additions and 140 deletions

View file

@ -19,6 +19,12 @@ The `menu` class has the following static methods:
Sets `menu` as the application menu on macOS. On Windows and Linux, the
`menu` will be set as each window's top menu.
Also on Windows and Linux, you can use a `&` in the top-level item name to
indicate which letter should get a generated accelerator. For example, using
`&File` for the file menu would result in a generated `Alt-F` accelerator that
opens the associated menu. The indicated character in the button label gets an
underline. The `&` character is not displayed on the button label.
Passing `null` will remove the menu bar on Windows and Linux but has no
effect on macOS.