Fix app menu for darwin

This commit is contained in:
AkiraFukushima 2023-02-27 19:08:25 +09:00
parent b74de6e950
commit f5977749c5
2 changed files with 19 additions and 18 deletions

View File

@ -12,10 +12,6 @@
"open": "Open window",
"quit": "Quit"
},
"toot": {
"name": "Posts",
"new": "New post..."
},
"edit": {
"name": "Edit",
"undo": "Undo",
@ -36,6 +32,9 @@
"open": "Open Window",
"minimize": "Minimize",
"jump_to": "Jump to"
},
"help": {
"name": "Help"
}
},
"global_header": {

View File

@ -422,15 +422,11 @@ app.on('window-all-closed', () => {
// Preferences
menu.items[0].submenu.items[2].enabled = false
}
if (menu.items[1].submenu) {
// New Toot
menu.items[1].submenu.items[0].enabled = false
}
if (menu.items[4].submenu) {
if (menu.items[3].submenu) {
// Open Window
menu.items[4].submenu.items[1].enabled = true
menu.items[3].submenu.items[1].enabled = true
// Jump to
menu.items[4].submenu.items[4].enabled = false
menu.items[3].submenu.items[4].enabled = false
}
}
}
@ -949,13 +945,6 @@ const ApplicationMenu = (accountsChange: Array<MenuItemConstructorOptions>, menu
mainWindow!.webContents.send('open-preferences')
}
},
{
label: i18n.t<string>('main_menu.application.shortcuts'),
accelerator: 'Shift+?',
click: () => {
mainWindow!.webContents.send('open-shortcuts-list')
}
},
...macGeneralMenu,
{
type: 'separator'
@ -1045,6 +1034,19 @@ const ApplicationMenu = (accountsChange: Array<MenuItemConstructorOptions>, menu
},
...accountsChange
]
},
{
label: i18n.t<string>("main_menu.help.name"),
role: "help",
submenu: [
{
label: i18n.t<string>('main_menu.application.shortcuts'),
accelerator: 'Shift+?',
click: () => {
mainWindow!.webContents.send('open-shortcuts-list')
}
},
]
}
]