diff --git a/src/config/locales/en/translation.json b/src/config/locales/en/translation.json index e3199adb..60e2f76b 100644 --- a/src/config/locales/en/translation.json +++ b/src/config/locales/en/translation.json @@ -29,6 +29,7 @@ "toggle_full_screen": "Toggle Full Screen" }, "window": { + "always_show_menu_bar": "Always Show Menu Bar", "name": "Window", "close": "Close Window", "open": "Open Window", diff --git a/src/main/index.ts b/src/main/index.ts index 9fd7e7b5..c16a7f6d 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1330,6 +1330,17 @@ const ApplicationMenu = (accountsChange: Array, i18n { label: i18n.t('main_menu.window.name'), submenu: [ + { + label: i18n.t('main_menu.window.always_show_menu_bar'), + type: 'checkbox', + checked: true, + click: item => { + changeMenuAutoHide(!item.checked) + } + }, + { + type: 'separator' + }, { label: i18n.t('main_menu.window.close'), role: 'close' @@ -1392,6 +1403,15 @@ const TrayMenu = (accountsChange: Array, i18n: I18n) return menu } +async function changeMenuAutoHide(autoHide: boolean) { + if (mainWindow === null) { + return null + } + mainWindow.autoHideMenuBar = autoHide + mainWindow.setMenuBarVisibility(!autoHide) + return null +} + async function reopenWindow() { if (mainWindow === null) { await createWindow()