Skip to content

Commit

Permalink
Merge pull request #1550 from h3poteto/fix/mac-menu
Browse files Browse the repository at this point in the history
Remove menu bar menu when platform is darwin
  • Loading branch information
h3poteto authored Jun 15, 2020
2 parents ffa5e21 + dc6fb57 commit 9aca310
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,23 @@ const ApplicationMenu = (accountsChange: Array<MenuItemConstructorOptions>, menu
}
]

const macWindowMenu: Array<MenuItemConstructorOptions> =
process.platform === 'darwin'
? []
: [
{
label: i18n.t('main_menu.window.always_show_menu_bar'),
type: 'checkbox',
checked: !menu.autoHideMenu,
click: item => {
changeMenuAutoHide(!item.checked)
}
},
{
type: 'separator'
}
]

const template: Array<MenuItemConstructorOptions> = [
{
label: i18n.t('main_menu.application.name'),
Expand Down Expand Up @@ -1345,17 +1362,7 @@ const ApplicationMenu = (accountsChange: Array<MenuItemConstructorOptions>, menu
{
label: i18n.t('main_menu.window.name'),
submenu: [
{
label: i18n.t('main_menu.window.always_show_menu_bar'),
type: 'checkbox',
checked: !menu.autoHideMenu,
click: item => {
changeMenuAutoHide(!item.checked)
}
},
{
type: 'separator'
},
...macWindowMenu,
{
label: i18n.t('main_menu.window.close'),
role: 'close'
Expand Down

0 comments on commit 9aca310

Please sign in to comment.