软件内快捷键的最小化触发时,如果已启用托盘,则隐藏程序,否则最小化程序

This commit is contained in:
lyswhut
2021-08-22 10:26:59 +08:00
parent 8cd5a01dd5
commit ab86674aa3
4 changed files with 11 additions and 0 deletions
+1
View File
@@ -123,6 +123,7 @@ export default {
setting: {
handler(n, o) {
saveSetting(n)
global.appSetting = n
},
deep: true,
},
+8
View File
@@ -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
}
+1
View File
@@ -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