diff --git a/publish/changeLog.md b/publish/changeLog.md index a8ef389e..cde067f9 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -6,3 +6,4 @@ ### 优化 - 优化月里嫦娥皮肤侧栏鼠标悬浮颜色 +- 优化播放进度条的动画效果 diff --git a/src/main/events/winEvent.js b/src/main/events/winEvent.js new file mode 100644 index 00000000..5be73705 --- /dev/null +++ b/src/main/events/winEvent.js @@ -0,0 +1,13 @@ +module.exports = mainWindow => { + mainWindow.on('close', () => { + mainWindow.setProgressBar(-1) + }) + + mainWindow.on('closed', () => { + mainWindow = global.mainWindow = null + }) + + mainWindow.on('restore', () => { + mainWindow.webContents.send('restore') + }) +} diff --git a/src/main/index.js b/src/main/index.js index 055c60db..59c46d88 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -26,6 +26,7 @@ global.envParams = parseEnv() require('../common/error') require('./events') +const winEvent = require('./events/winEvent') const autoUpdate = require('./utils/autoUpdate') const { isLinux, isMac } = require('../common/utils') @@ -67,13 +68,7 @@ function createWindow() { mainWindow.loadURL(winURL) - mainWindow.on('close', () => { - mainWindow.setProgressBar(-1) - }) - mainWindow.on('closed', () => { - mainWindow = global.mainWindow = null - }) - + winEvent(mainWindow) // mainWindow.webContents.openDevTools() if (!isDev) { diff --git a/src/renderer/components/core/Player.vue b/src/renderer/components/core/Player.vue index f519f424..fcdfdf2e 100644 --- a/src/renderer/components/core/Player.vue +++ b/src/renderer/components/core/Player.vue @@ -48,7 +48,7 @@ div(:class="$style.player")