docs: update menu item '&' escaping (#27770)

This commit is contained in:
Michaela Laurencin 2021-02-18 22:41:16 -08:00 committed by GitHub
parent 6a9ba42273
commit 0dd283a7a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,8 +22,10 @@ Sets `menu` as the application menu on macOS. On Windows and Linux, the
Also on Windows and Linux, you can use a `&` in the top-level item name to 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 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 `&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 opens the associated menu. The indicated character in the button label then gets an
underline. The `&` character is not displayed on the button label. underline, and the `&` character is not displayed on the button label.
In order to escape the `&` character in an item name, add a proceeding `&`. For example, `&&File` would result in `&File` displayed on the button label.
Passing `null` will suppress the default menu. On Windows and Linux, Passing `null` will suppress the default menu. On Windows and Linux,
this has the additional effect of removing the menu bar from the window. this has the additional effect of removing the menu bar from the window.