diff --git a/src/main/Stores.ts b/src/main/Stores.ts index 3e1ca9e9..c54ec248 100644 --- a/src/main/Stores.ts +++ b/src/main/Stores.ts @@ -213,6 +213,7 @@ SettingsStore.onDidChange('colorTheme', (colorTheme) => { SettingsStore.onDidChange('menuBarVisibility', (menuBarVisibility) => { try { mainWindow!.setMenuBarVisibility(menuBarVisibility) + mainWindow!.setAutoHideMenuBar(!menuBarVisibility) } catch (error: any) { HandleError(error) } diff --git a/src/main/index.ts b/src/main/index.ts index 64e82a4a..a404c24f 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -111,11 +111,13 @@ const handleWindowSizeAndPosition = () => { const createMainWindow = () => { const shouldUseDarkColors: boolean = SettingsStore.get('shouldUseDarkColors') + const shouldShowMenubar: boolean = SettingsStore.get('menuBarVisibility') mainWindow = new BrowserWindow({ width: 1280, height: 1000, show: false, backgroundColor: shouldUseDarkColors ? '#212224' : '#fff', + autoHideMenuBar: !shouldShowMenubar, icon: process.platform === 'win32' ? nativeImage.createFromPath(windowsIcon) @@ -132,6 +134,7 @@ const createMainWindow = () => { }) mainWindow.once('ready-to-show', () => { + mainWindow.setMenuBarVisibility(shouldShowMenubar) mainWindow.show(); const endTime = performance.now() console.log(`Startup time: ${(endTime - startTime).toFixed(2)} ms`)