多次点击图标行为优化
This commit is contained in:
parent
cfd8242d1e
commit
b78e52c012
@ -67,7 +67,11 @@ function createWindow() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 托盘
|
// 托盘
|
||||||
tray = new Tray(isDev ? 'src/static/512x512.png' : path.join(global.__static, '512x512.png'))
|
tray = new Tray(
|
||||||
|
isDev
|
||||||
|
? 'src/static/512x512.png'
|
||||||
|
: path.join(global.__static, '512x512.png'),
|
||||||
|
)
|
||||||
const contextMenu = Menu.buildFromTemplate([
|
const contextMenu = Menu.buildFromTemplate([
|
||||||
{
|
{
|
||||||
label: '退出',
|
label: '退出',
|
||||||
@ -79,10 +83,8 @@ function createWindow() {
|
|||||||
tray.setToolTip('洛雪音乐助手')
|
tray.setToolTip('洛雪音乐助手')
|
||||||
tray.setContextMenu(contextMenu)
|
tray.setContextMenu(contextMenu)
|
||||||
tray.on('click', () => {
|
tray.on('click', () => {
|
||||||
mainWindow.isVisible() ? mainWindow.hide() : mainWindow.show()
|
mainWindow.show()
|
||||||
mainWindow.isVisible()
|
mainWindow.setSkipTaskbar(false)
|
||||||
? mainWindow.setSkipTaskbar(false)
|
|
||||||
: mainWindow.setSkipTaskbar(true)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
mainWindow.loadURL(winURL)
|
mainWindow.loadURL(winURL)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user