]> khamidou — GitHub mirrors - electron.git/commitdiff
mac: Enable setting "Services" menu.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 5 Sep 2014 05:07:05 +0000 (13:07 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 5 Sep 2014 05:07:05 +0000 (13:07 +0800)
Regarding https://github.com/atom/atom/issues/3204.

atom/browser/default_app/default_app.js
atom/browser/ui/cocoa/atom_menu_controller.mm

index c79d544694fdab1d035e9e33c2bb5ef322b06803..0e1b64d29015f5b97b49b9fbf0f4a01f13e1d966 100644 (file)
@@ -34,6 +34,13 @@ app.on('ready', function() {
           {
             type: 'separator'
           },
+          {
+            label: 'Services',
+            submenu: []
+          },
+          {
+            type: 'separator'
+          },
           {
             label: 'Hide Atom Shell',
             accelerator: 'Command+H',
index 05e4b4cc41d77d53e8d1644aa8d967dae6157450..e0f22e3ba965fdec53cccaef9fa9602f21314fa7 100644 (file)
@@ -159,6 +159,9 @@ int EventFlagsFromNSEvent(NSEvent* event) {
       [NSApp setWindowsMenu:submenu];
     else if ([[item title] isEqualToString:@"Help"])
       [NSApp setHelpMenu:submenu];
+    if ([[item title] isEqualToString:@"Services"] &&
+        [submenu numberOfItems] == 0)
+      [NSApp setServicesMenu: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