From e419401ad9c5e88005369caa5f84223370e25e0d Mon Sep 17 00:00:00 2001 From: Evan BLAUDY Date: Thu, 16 Dec 2021 00:38:31 +0100 Subject: [PATCH] [main] autohide menu bar (press ALT to show the menu) + remove help submenu --- app/main/src/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/main/src/index.js b/app/main/src/index.js index 28514e3..82ffbee 100644 --- a/app/main/src/index.js +++ b/app/main/src/index.js @@ -3,7 +3,8 @@ import { BrowserWindow, session, nativeTheme, - ipcMain /**shell*/ + ipcMain, + Menu /**shell*/ } from 'electron' import { join } from 'path' import { URL } from 'url' @@ -80,6 +81,12 @@ const createWindow = async () => { } }) + const old_menu = Menu.getApplicationMenu() + const new_menu = old_menu?.items.filter((item) => item.role !== 'help') + Menu.setApplicationMenu(Menu.buildFromTemplate(new_menu)) + mainWindow.setAutoHideMenuBar(true) + mainWindow.menuBarVisible = false + switch (process.platform) { case 'win32': mainWindow.setIcon(