Add default label/accelerator to role menu items
This commit is contained in:
parent
25b2724ab9
commit
13a6d32ee9
2 changed files with 17 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const roles = require('./menu-item-roles')
|
||||
|
||||
let nextCommandId = 0
|
||||
|
||||
// Maps role to methods of webContents
|
||||
|
@ -58,11 +60,11 @@ const MenuItem = function (options) {
|
|||
|
||||
this.overrideReadOnlyProperty('type', 'normal')
|
||||
this.overrideReadOnlyProperty('role')
|
||||
this.overrideReadOnlyProperty('accelerator')
|
||||
this.overrideReadOnlyProperty('accelerator', roles.getDefaultAccelerator(this.role))
|
||||
this.overrideReadOnlyProperty('icon')
|
||||
this.overrideReadOnlyProperty('submenu')
|
||||
|
||||
this.overrideProperty('label', '')
|
||||
this.overrideProperty('label', roles.getDefaultLabel(this.role))
|
||||
this.overrideProperty('sublabel', '')
|
||||
this.overrideProperty('enabled', true)
|
||||
this.overrideProperty('visible', true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue