Skip to content

Commit

Permalink
[main] autohide menu bar (press ALT to show the menu) + remove help s…
Browse files Browse the repository at this point in the history
…ubmenu
  • Loading branch information
EvanBldy committed Dec 15, 2021
1 parent 9abab25 commit e419401
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/main/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
BrowserWindow,
session,
nativeTheme,
ipcMain /**shell*/
ipcMain,
Menu /**shell*/
} from 'electron'
import { join } from 'path'
import { URL } from 'url'
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit e419401

Please sign in to comment.