Add menu to reopen window after close window in macOS
This commit is contained in:
parent
a59646307f
commit
2b19f103e0
|
@ -30,6 +30,7 @@
|
|||
"window": {
|
||||
"name": "Fenster",
|
||||
"close": "Fenster schließen",
|
||||
"open": "Open Window",
|
||||
"minimize": "Minimieren",
|
||||
"jump_to": "Springe zu"
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
"window": {
|
||||
"name": "Window",
|
||||
"close": "Close Window",
|
||||
"open": "Open Window",
|
||||
"minimize": "Minimize",
|
||||
"jump_to": "Jump to"
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
"window": {
|
||||
"name": "Fenêtre",
|
||||
"close": "Fermer la fenêtre",
|
||||
"open": "Open Window",
|
||||
"minimize": "Minimiser",
|
||||
"jump_to": "Aller à"
|
||||
}
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
},
|
||||
"window": {
|
||||
"name": "ウィンドウ",
|
||||
"close": "閉じる",
|
||||
"close": "ウィンドウを閉じる",
|
||||
"open": "ウィンドウを表示",
|
||||
"minimize": "縮小",
|
||||
"jump_to": "ジャンプ"
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
"window": {
|
||||
"name": "창",
|
||||
"close": "창 닫기",
|
||||
"open": "Open Window",
|
||||
"minimize": "최소화",
|
||||
"jump_to": "이동"
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
"window": {
|
||||
"name": "Okno",
|
||||
"close": "Zamknij okno",
|
||||
"open": "Open Window",
|
||||
"minimize": "Zminimalizuj",
|
||||
"jump_to": "Przejdź do"
|
||||
}
|
||||
|
|
|
@ -227,8 +227,10 @@ app.on('window-all-closed', () => {
|
|||
menu.items[0].submenu.items[2].enabled = false
|
||||
// New Toot
|
||||
menu.items[1].submenu.items[0].enabled = false
|
||||
// Open Window
|
||||
menu.items[4].submenu.items[1].enabled = true
|
||||
// Jump to
|
||||
menu.items[4].submenu.items[3].enabled = false
|
||||
menu.items[4].submenu.items[4].enabled = false
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -870,6 +872,13 @@ const ApplicationMenu = (accountsChange, i18n) => {
|
|||
label: i18n.t('main_menu.window.close'),
|
||||
role: 'close'
|
||||
},
|
||||
{
|
||||
label: i18n.t('main_menu.window.open'),
|
||||
enabled: false,
|
||||
click: () => {
|
||||
reopenWindow()
|
||||
}
|
||||
},
|
||||
{
|
||||
label: i18n.t('main_menu.window.minimize'),
|
||||
role: 'minimize'
|
||||
|
@ -896,3 +905,12 @@ const ApplicationMenu = (accountsChange, i18n) => {
|
|||
const menu = Menu.buildFromTemplate(template)
|
||||
Menu.setApplicationMenu(menu)
|
||||
}
|
||||
|
||||
async function reopenWindow () {
|
||||
if (mainWindow === null) {
|
||||
await createWindow()
|
||||
return null
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue