Generate menu group id automatically.
In GTK+ radio menu items are managed automatically, so group id won't have any effect there, in the meanwhile we need to maintain the same behavior on all platforms, so we have to generate group id instead of letting users specifying it.
This commit is contained in:
parent
76d0d3ec19
commit
04fbec5120
3 changed files with 37 additions and 16 deletions
|
@ -8,7 +8,7 @@ class MenuItem
|
|||
constructor: (options) ->
|
||||
Menu = require 'menu'
|
||||
|
||||
{click, @selector, @type, @label, @sublabel, @accelerator, @enabled, @visible, @checked, @groupId, @submenu} = options
|
||||
{click, @selector, @type, @label, @sublabel, @accelerator, @enabled, @visible, @checked, @submenu} = options
|
||||
|
||||
@type = 'submenu' if not @type? and @submenu?
|
||||
throw new Error('Invalid submenu') if @type is 'submenu' and @submenu?.constructor isnt Menu
|
||||
|
@ -20,7 +20,6 @@ class MenuItem
|
|||
@enabled = @enabled ? true
|
||||
@visible = @visible ? true
|
||||
@checked = @checked ? false
|
||||
@groupId = @groupId ? null
|
||||
@submenu = @submenu ? null
|
||||
|
||||
throw new Error('Unknown menu type') if MenuItem.types.indexOf(@type) is -1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue