mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
mac: Enable to set the 'Help' menu, fixes #109.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user