mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: allow MenuItems to work optionally when hidden (#16853)
* feat: allow MenuItems to work optionally when hidden * fix: actually include forward_declaration
This commit is contained in:
@@ -24,6 +24,7 @@ See [`Menu`](menu.md) for examples.
|
||||
* `icon` ([NativeImage](native-image.md) | String) (optional)
|
||||
* `enabled` Boolean (optional) - If false, the menu item will be greyed out and
|
||||
unclickable.
|
||||
* `acceleratorWorksWhenHidden` Boolean (optional) - default is `true`, and when `false` will prevent the accelerator from triggering the item if the item is not visible`. _macOS_
|
||||
* `visible` Boolean (optional) - If false, the menu item will be entirely hidden.
|
||||
* `checked` Boolean (optional) - Should only be specified for `checkbox` or `radio` type
|
||||
menu items.
|
||||
@@ -48,6 +49,8 @@ See [`Menu`](menu.md) for examples.
|
||||
the placement of their containing group after the containing group of the item
|
||||
with the specified label.
|
||||
|
||||
**Note:** `acceleratorWorksWhenHidden` is specified as being macOS-only because accelerators always work when items are hidden on Windows and Linux. The option is exposed to users to give them the option to turn it off, as this is possible in native macOS development. This property is only usable on macOS High Sierra 10.13 or newer.
|
||||
|
||||
### Roles
|
||||
|
||||
Roles allow menu items to have predefined behaviors.
|
||||
|
||||
Reference in New Issue
Block a user