From ab86674aa38d9af6bf9ce5e6d63cf473a286b65d Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sun, 22 Aug 2021 10:26:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E5=86=85=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E9=94=AE=E7=9A=84=E6=9C=80=E5=B0=8F=E5=8C=96=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=B7=B2=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E6=89=98=E7=9B=98=EF=BC=8C=E5=88=99=E9=9A=90=E8=97=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=EF=BC=8C=E5=90=A6=E5=88=99=E6=9C=80=E5=B0=8F=E5=8C=96?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/renderer/App.vue | 1 + src/renderer/event/index.js | 8 ++++++++ src/renderer/main.js | 1 + 4 files changed, 11 insertions(+) diff --git a/publish/changeLog.md b/publish/changeLog.md index a3b32d9d..3ca4fcb9 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -8,6 +8,7 @@ ### 优化 - 支持网易源“我喜欢”歌单以注入token的方式打开。由于网易源的“我喜欢”歌单需要登录才能打开(若你看不懂后半句就去阅读 常见问题-无法打开外部歌单),现若想要打开此类歌单,需要在歌单链接后面拼上 `###` 再加上有效的token,拼接格式:`[id|url]###token`,例子(最后面的xxxxxx替换成你的token):`https://music.163.com/#/playlist?id=123456&userid=123456###xxxxxx` +- 软件内快捷键的最小化触发时,如果已启用托盘,则隐藏程序,否则最小化程序 ### 修复 diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 5e548f19..4b9e380c 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -123,6 +123,7 @@ export default { setting: { handler(n, o) { saveSetting(n) + global.appSetting = n }, deep: true, }, diff --git a/src/renderer/event/index.js b/src/renderer/event/index.js index 29374416..efb3622a 100644 --- a/src/renderer/event/index.js +++ b/src/renderer/event/index.js @@ -25,6 +25,14 @@ eventHub.$on(baseName.bindKey, () => { // console.log(event, key) if (!window.isEditingHotKey && appHotKeyConfig.local.enable && appHotKeyConfig.local.keys[key]) { if (type == 'up') return + + // 软件内快捷键的最小化触发时 + // 如果已启用托盘,则隐藏程序,否则最小化程序 https://github.com/lyswhut/lx-music-desktop/issues/603 + if (appHotKeyConfig.local.keys[key].action == hotKeyNamesCommon.min.action && global.appSetting.tray.isToTray) { + eventHub.$emit(hotKeyNamesCommon.hide_toggle.action) + return + } + eventHub.$emit(appHotKeyConfig.local.keys[key].action) return } diff --git a/src/renderer/main.js b/src/renderer/main.js index a2cf9259..2ad40edb 100644 --- a/src/renderer/main.js +++ b/src/renderer/main.js @@ -26,6 +26,7 @@ Vue.config.productionTip = false Vue.config.devtools = process.env.NODE_ENV === 'development' getSetting().then(({ setting, version }) => { + global.appSetting = setting // Set language automatically if (!window.i18n.availableLocales.includes(setting.langId)) { let langId = null