From c99da2ccaa24e648c6744d702922e7dead643f70 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 11 May 2016 19:26:15 +0200 Subject: [PATCH] Remove Window menu on Linux and Windows The Window menu is apparently an OS X only convention. I couldn't find a single app on Windows or Linux that had this menu or even a "minimize" menu item. --- main/menu.js | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/main/menu.js b/main/menu.js index db43e6f7..fe8d0f36 100644 --- a/main/menu.js +++ b/main/menu.js @@ -268,17 +268,6 @@ function getAppMenuTemplate () { } ] }, - { - label: 'Window', - role: 'window', - submenu: [ - { - label: 'Minimize', - accelerator: 'CmdOrCtrl+M', - role: 'minimize' - } - ] - }, { label: 'Help', role: 'help', @@ -303,7 +292,7 @@ function getAppMenuTemplate () { ] if (process.platform === 'darwin') { - // WebTorrent menu (OS X) + // Add WebTorrent app menu (OS X) template.unshift({ label: config.APP_NAME, submenu: [ @@ -347,16 +336,25 @@ function getAppMenuTemplate () { ] }) - // Window menu (OS X) - template[5].submenu.push( - { - type: 'separator' - }, - { - label: 'Bring All to Front', - role: 'front' - } - ) + // 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' + } + ] + }) } // In Linux and Windows it is not possible to open both folders and files @@ -368,7 +366,7 @@ function getAppMenuTemplate () { }) // Help menu (Windows, Linux) - template[5].submenu.push( + template[4].submenu.push( { type: 'separator' },