mac: Enable to set the 'Help' menu, fixes #109.
This commit is contained in:
parent
acda56210b
commit
7c30d037a3
2 changed files with 7 additions and 1 deletions
|
@ -154,9 +154,11 @@ int EventFlagsFromNSEvent(NSEvent* event) {
|
|||
[submenu setTitle:[item title]];
|
||||
[item setSubmenu:submenu];
|
||||
|
||||
// Hack to set window menu.
|
||||
// Hack to set window and help menu.
|
||||
if ([[item title] isEqualToString:@"Window"] && [submenu numberOfItems] > 0)
|
||||
[NSApp setWindowsMenu:submenu];
|
||||
else if ([[item title] isEqualToString:@"Help"])
|
||||
[NSApp setHelpMenu:submenu];
|
||||
} else {
|
||||
// The MenuModel works on indexes so we can't just set the command id as the
|
||||
// tag like we do in other menus. Also set the represented object to be
|
||||
|
|
|
@ -84,6 +84,10 @@ app.on('finish-launching', function() {
|
|||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Help',
|
||||
submenu: [],
|
||||
}
|
||||
];
|
||||
|
||||
var menu = Menu.buildFromTemplate(template);
|
||||
|
|
Loading…
Reference in a new issue