feat: add registerAccelerator flag to allow menu items to optionally skip accelerator registration (backport: 3-1-x) (#15892)
* feat: add registerAccelerator flag to allow menu items to skip registration * docs: add docs for registerAccelerator
This commit is contained in:
parent
bb28fa8e8e
commit
6d5b225ac5
9 changed files with 43 additions and 7 deletions
|
@ -36,6 +36,7 @@ const MenuItem = function (options) {
|
|||
this.overrideProperty('enabled', true)
|
||||
this.overrideProperty('visible', true)
|
||||
this.overrideProperty('checked', false)
|
||||
this.overrideProperty('registerAccelerator', roles.shouldRegisterAccelerator(this.role))
|
||||
|
||||
if (!MenuItem.types.includes(this.type)) {
|
||||
throw new Error(`Unknown menu item type: ${this.type}`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue