mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 改进系统托盘单击交互 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()) {
|
if (mainWindow.isMinimized()) {
|
||||||
mainWindow.restore()
|
mainWindow.restore()
|
||||||
}
|
}
|
||||||
showWndMenu.label = "Hide Window"
|
|
||||||
trayMenuTemplate.splice(0, 1, showWndMenu)
|
|
||||||
const contextMenu = Menu.buildFromTemplate(trayMenuTemplate)
|
|
||||||
tray.setContextMenu(contextMenu)
|
|
||||||
mainWindow.show()
|
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 {
|
} else {
|
||||||
mainWindow.hide()
|
mainWindow.hide()
|
||||||
showWndMenu.label = "Show Window"
|
|
||||||
trayMenuTemplate.splice(0, 1, showWndMenu)
|
if ('win32' === process.platform || 'linux' === process.platform) {
|
||||||
const contextMenu = Menu.buildFromTemplate(trayMenuTemplate)
|
showWndMenu.label = "Show Window"
|
||||||
tray.setContextMenu(contextMenu)
|
trayMenuTemplate.splice(0, 1, showWndMenu)
|
||||||
|
const contextMenu = Menu.buildFromTemplate(trayMenuTemplate)
|
||||||
|
tray.setContextMenu(contextMenu)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue