From 4533f7b1d56c35de6a3120a82ccd256c898dfc71 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 2 Mar 2020 15:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=92=AD=E6=94=BE=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=9D=A1=E7=9A=84=E5=8A=A8=E7=94=BB=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/main/events/winEvent.js | 13 +++++++++++++ src/main/index.js | 9 ++------- src/renderer/components/core/Player.vue | 14 ++++++++++++-- 4 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 src/main/events/winEvent.js 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")