create a linkable heading for MenuItem roles
This commit is contained in:
parent
57edc28b0d
commit
d779ecf674
1 changed files with 10 additions and 7 deletions
|
@ -15,7 +15,7 @@ See [`Menu`](menu.md) for examples.
|
||||||
* `browserWindow` BrowserWindow
|
* `browserWindow` BrowserWindow
|
||||||
* `event` Event
|
* `event` Event
|
||||||
* `role` String (optional) - Define the action of the menu item, when specified the
|
* `role` String (optional) - Define the action of the menu item, when specified the
|
||||||
`click` property will be ignored.
|
`click` property will be ignored. See [roles](#roles).
|
||||||
* `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
|
* `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
|
||||||
`radio`.
|
`radio`.
|
||||||
* `label` String - (optional)
|
* `label` String - (optional)
|
||||||
|
@ -36,12 +36,16 @@ See [`Menu`](menu.md) for examples.
|
||||||
* `position` String (optional) - This field allows fine-grained definition of the
|
* `position` String (optional) - This field allows fine-grained definition of the
|
||||||
specific location within a given menu.
|
specific location within a given menu.
|
||||||
|
|
||||||
|
### Roles
|
||||||
|
|
||||||
|
Roles allow menu items to have predefined behaviors.
|
||||||
|
|
||||||
It is best to specify `role` for any menu item that matches a standard role,
|
It is best to specify `role` for any menu item that matches a standard role,
|
||||||
rather than trying to manually implement the behavior in a `click` function.
|
rather than trying to manually implement the behavior in a `click` function.
|
||||||
The built-in `role` behavior will give the best native experience.
|
The built-in `role` behavior will give the best native experience.
|
||||||
|
|
||||||
The `label` and `accelerator` are optional when using a `role` and will default
|
The `label` and `accelerator` values are optional when using a `role` and will
|
||||||
to appropriate values for each platform.
|
default to appropriate values for each platform.
|
||||||
|
|
||||||
The `role` property can have following values:
|
The `role` property can have following values:
|
||||||
|
|
||||||
|
@ -63,11 +67,10 @@ The `role` property can have following values:
|
||||||
* `resetzoom` - Reset the focused page's zoom level to the original size
|
* `resetzoom` - Reset the focused page's zoom level to the original size
|
||||||
* `zoomin` - Zoom in the focused page by 10%
|
* `zoomin` - Zoom in the focused page by 10%
|
||||||
* `zoomout` - Zoom out the focused page by 10%
|
* `zoomout` - Zoom out the focused page by 10%
|
||||||
|
|
||||||
* `editMenu` - Whole default "Edit" menu (Undo, Copy, etc.)
|
* `editMenu` - Whole default "Edit" menu (Undo, Copy, etc.)
|
||||||
* `windowMenu` - Whole default "Window" menu (Minimize, Close, etc.)
|
* `windowMenu` - Whole default "Window" menu (Minimize, Close, etc.)
|
||||||
|
|
||||||
On macOS `role` can also have following additional values:
|
The following additional roles are avaiable on macOS:
|
||||||
|
|
||||||
* `about` - Map to the `orderFrontStandardAboutPanel` action
|
* `about` - Map to the `orderFrontStandardAboutPanel` action
|
||||||
* `hide` - Map to the `hide` action
|
* `hide` - Map to the `hide` action
|
||||||
|
@ -81,8 +84,8 @@ On macOS `role` can also have following additional values:
|
||||||
* `help` - The submenu is a "Help" menu
|
* `help` - The submenu is a "Help" menu
|
||||||
* `services` - The submenu is a "Services" menu
|
* `services` - The submenu is a "Services" menu
|
||||||
|
|
||||||
When specifying `role` on macOS, `label` and `accelerator` are the only options
|
When specifying a `role` on macOS, `label` and `accelerator` are the only
|
||||||
that will affect the MenuItem. All other options will be ignored.
|
options that will affect the menu item. All other options will be ignored.
|
||||||
|
|
||||||
### Instance Properties
|
### Instance Properties
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue