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

View File

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