mac: Enable to set the 'Help' menu, fixes #109.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 17 Oct 2013 02:15:57 +0000 (10:15 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 17 Oct 2013 02:21:24 +0000 (10:21 +0800)
browser/ui/atom_menu_controller_mac.mm
spec/main.js

index ea4a0d9..e0f5bdb 100644 (file)
@@ -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
index 77edf91..f9d77d0 100644 (file)
@@ -84,6 +84,10 @@ app.on('finish-launching', function() {
         },
       ]
     },
+    {
+      label: 'Help',
+      submenu: [],
+    }
   ];
 
   var menu = Menu.buildFromTemplate(template);