From cbe7068091858aafd8eaa97ca4c7966f4d9e0611 Mon Sep 17 00:00:00 2001 From: ShadyThGod Date: Tue, 26 Feb 2019 21:38:20 +0530 Subject: [PATCH] Fixed menus on macOS Fixed menus of child windows on macOS --- src/windows/about/js/about.js | 29 +------------------ src/windows/customCSS/js/customCSS.js | 2 +- src/windows/settings/js/settings.js | 2 +- .../themeCustomizer/js/themeCustomizer.js | 2 +- src/windows/themeManager/js/themeManager.js | 2 +- 5 files changed, 5 insertions(+), 32 deletions(-) diff --git a/src/windows/about/js/about.js b/src/windows/about/js/about.js index 862c845c..a646b7ce 100644 --- a/src/windows/about/js/about.js +++ b/src/windows/about/js/about.js @@ -9,38 +9,11 @@ const { ipcRenderer } = require('electron'); -const linksMenu = new Menu(); - -linksMenu.append(new MenuItem({ - label: 'Links', - submenu: [{ - label: 'Website', - click: () => { - ipcRenderer.send('link-open', 'https://shadythgod.github.io'); - } - }, { - label: 'GitHub', - click: () => { - ipcRenderer.send('link-open', 'https://www.github.com/shadythgod'); - } - }, { - label: 'Repository', - click: () => { - ipcRenderer.send('link-open', 'https://www.github.com/shadythgod/altus'); - } - }, { - label: 'My Instagram', - click: () => { - ipcRenderer.send('link-open', 'https://www.instagram.com/aman_harwara'); - } - }] -})); - // Create main window titlebar const mainTitlebar = new customTitlebar.Titlebar({ backgroundColor: customTitlebar.Color.fromHex('#21252B'), icon: '../assets/icons/icon.ico', - menu: linksMenu, + menu: process.platform === 'darwin' ? Menu.getApplicationMenu() : new Menu(), minimizable: false, maximizable: false, closeable: true diff --git a/src/windows/customCSS/js/customCSS.js b/src/windows/customCSS/js/customCSS.js index 4ad9dced..bc9e0d43 100644 --- a/src/windows/customCSS/js/customCSS.js +++ b/src/windows/customCSS/js/customCSS.js @@ -11,7 +11,7 @@ const { const mainTitlebar = new customTitlebar.Titlebar({ backgroundColor: customTitlebar.Color.fromHex('#21252B'), icon: '../assets/icons/icon.ico', - menu: new Menu(), + menu: process.platform === 'darwin' ? Menu.getApplicationMenu() : new Menu(), minimizable: false, maximizable: false, closeable: true diff --git a/src/windows/settings/js/settings.js b/src/windows/settings/js/settings.js index 00ca3307..075393c2 100644 --- a/src/windows/settings/js/settings.js +++ b/src/windows/settings/js/settings.js @@ -18,7 +18,7 @@ const settings = new Store({ const mainTitlebar = new customTitlebar.Titlebar({ backgroundColor: customTitlebar.Color.fromHex('#21252B'), icon: '../assets/icons/icon.ico', - menu: new Menu(), + menu: process.platform === 'darwin' ? Menu.getApplicationMenu() : new Menu(), minimizable: false, maximizable: false, closeable: true diff --git a/src/windows/themeCustomizer/js/themeCustomizer.js b/src/windows/themeCustomizer/js/themeCustomizer.js index 17a1d474..2cefa986 100644 --- a/src/windows/themeCustomizer/js/themeCustomizer.js +++ b/src/windows/themeCustomizer/js/themeCustomizer.js @@ -9,7 +9,7 @@ let cssClipboard = new ClipboardJS('#copy-css-button'); const mainTitlebar = new customTitlebar.Titlebar({ backgroundColor: customTitlebar.Color.fromHex('#21252B'), icon: '../assets/icons/icon.ico', - menu: new Menu(), + menu: process.platform === 'darwin' ? Menu.getApplicationMenu() : new Menu(), minimizable: false, maximizable: false, closeable: true diff --git a/src/windows/themeManager/js/themeManager.js b/src/windows/themeManager/js/themeManager.js index cabb6ad8..a77818e7 100644 --- a/src/windows/themeManager/js/themeManager.js +++ b/src/windows/themeManager/js/themeManager.js @@ -10,7 +10,7 @@ const Store = require('electron-store'); const mainTitlebar = new customTitlebar.Titlebar({ backgroundColor: customTitlebar.Color.fromHex('#21252B'), icon: '../assets/icons/icon.ico', - menu: new Menu(), + menu: process.platform === 'darwin' ? Menu.getApplicationMenu() : new Menu(), minimizable: false, maximizable: false, closeable: true