修复托盘创建显示隐藏Bug
This commit is contained in:
@@ -1,17 +1,12 @@
|
||||
// const { app } = require('electron')
|
||||
const { mainOn } = require('../../common/ipc')
|
||||
|
||||
mainOn('changeTray', (event, params) => {
|
||||
switch (params.action) {
|
||||
case 'create':
|
||||
global.lx_event.tray.create()
|
||||
break
|
||||
case 'destroy':
|
||||
global.lx_event.tray.destroy()
|
||||
break
|
||||
|
||||
default:
|
||||
break
|
||||
mainOn('changeTray', (event, setting) => {
|
||||
global.appSetting.tray = setting
|
||||
if (setting.isToTray) {
|
||||
global.lx_event.tray.create()
|
||||
} else {
|
||||
global.lx_event.tray.destroy()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
module.exports = mainWindow => {
|
||||
mainWindow.on('close', () => {
|
||||
mainWindow.on('close', event => {
|
||||
if (global.appSetting.tray.isToTray) {
|
||||
event.preventDefault()
|
||||
mainWindow.hide()
|
||||
return
|
||||
}
|
||||
mainWindow.setProgressBar(-1)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user