🎨 改进系统托盘单击交互 Fix https://github.com/siyuan-note/siyuan/issues/6861
This commit is contained in:
parent
1e8b027434
commit
06d2956022
1 changed files with 14 additions and 8 deletions
|
@ -444,17 +444,23 @@ const boot = () => {
|
|||
if (mainWindow.isMinimized()) {
|
||||
mainWindow.restore()
|
||||
}
|
||||
showWndMenu.label = "Hide Window"
|
||||
trayMenuTemplate.splice(0, 1, showWndMenu)
|
||||
const contextMenu = Menu.buildFromTemplate(trayMenuTemplate)
|
||||
tray.setContextMenu(contextMenu)
|
||||
mainWindow.show()
|
||||
|
||||
if ('win32' === process.platform || 'linux' === process.platform) {
|
||||
showWndMenu.label = "Hide Window"
|
||||
trayMenuTemplate.splice(0, 1, showWndMenu)
|
||||
const contextMenu = Menu.buildFromTemplate(trayMenuTemplate)
|
||||
tray.setContextMenu(contextMenu)
|
||||
}
|
||||
} else {
|
||||
mainWindow.hide()
|
||||
showWndMenu.label = "Show Window"
|
||||
trayMenuTemplate.splice(0, 1, showWndMenu)
|
||||
const contextMenu = Menu.buildFromTemplate(trayMenuTemplate)
|
||||
tray.setContextMenu(contextMenu)
|
||||
|
||||
if ('win32' === process.platform || 'linux' === process.platform) {
|
||||
showWndMenu.label = "Show Window"
|
||||
trayMenuTemplate.splice(0, 1, showWndMenu)
|
||||
const contextMenu = Menu.buildFromTemplate(trayMenuTemplate)
|
||||
tray.setContextMenu(contextMenu)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue