From 5796ba32a64d3f4902d57b9a9e4a3631c1319e16 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 25 Jul 2016 15:21:46 -0700 Subject: [PATCH] Electron: Use default labels and accelerators Less code for us to maintain. This also gives us free internationalization in a future Electron version (they'll set the label dynamically based on the 'role') One slight regression with this change, but it will be fixed in a future Electron once this PR is merged: https://github.com/electron/electron/pull/6600 --- src/main/menu.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/main/menu.js b/src/main/menu.js index f8fac0c9..8e4ecac8 100644 --- a/src/main/menu.js +++ b/src/main/menu.js @@ -99,10 +99,6 @@ function getMenuTemplate () { type: 'separator' }, { - label: process.platform === 'win32' - ? 'Close' - : 'Close Window', - accelerator: 'CmdOrCtrl+W', role: 'close' } ] @@ -111,23 +107,16 @@ function getMenuTemplate () { label: 'Edit', submenu: [ { - label: 'Cut', - accelerator: 'CmdOrCtrl+X', role: 'cut' }, { - label: 'Copy', - accelerator: 'CmdOrCtrl+C', role: 'copy' }, { label: 'Paste Torrent Address', - accelerator: 'CmdOrCtrl+V', role: 'paste' }, { - label: 'Select All', - accelerator: 'CmdOrCtrl+A', role: 'selectall' }, { @@ -285,7 +274,6 @@ function getMenuTemplate () { label: config.APP_NAME, submenu: [ { - label: 'About ' + config.APP_NAME, role: 'about' }, { @@ -300,7 +288,6 @@ function getMenuTemplate () { type: 'separator' }, { - label: 'Services', role: 'services', submenu: [] }, @@ -308,17 +295,12 @@ function getMenuTemplate () { type: 'separator' }, { - label: 'Hide ' + config.APP_NAME, - accelerator: 'Command+H', role: 'hide' }, { - label: 'Hide Others', - accelerator: 'Command+Alt+H', role: 'hideothers' }, { - label: 'Show All', role: 'unhide' }, { @@ -334,19 +316,15 @@ function getMenuTemplate () { // Add Window menu (OS X) template.splice(5, 0, { - label: 'Window', role: 'window', submenu: [ { - label: 'Minimize', - accelerator: 'CmdOrCtrl+M', role: 'minimize' }, { type: 'separator' }, { - label: 'Bring All to Front', role: 'front' } ]