diff --git a/build-config/build-pack.js b/build-config/build-pack.js index f47f0107..d93bfefa 100644 --- a/build-config/build-pack.js +++ b/build-config/build-pack.js @@ -106,18 +106,17 @@ const macOptions = { }, dmg: { window: { - width: 600, - height: 400, + width: 530, + height: 380, }, contents: [ { - x: 106, - y: 252, - name: 'LX Music', + x: 140, + y: 200, }, { - x: 490, - y: 252, + x: 390, + y: 200, type: 'link', path: '/Applications', }, diff --git a/src/renderer/core/useApp/useEventListener.ts b/src/renderer/core/useApp/useEventListener.ts index afbdbac1..2ecc1ee1 100644 --- a/src/renderer/core/useApp/useEventListener.ts +++ b/src/renderer/core/useApp/useEventListener.ts @@ -101,7 +101,7 @@ export default () => { const rSetConfig = onSettingChanged(({ params: setting }) => { // console.log(config) mergeSetting(setting) - window.app_event.configUpdate() + window.app_event.configUpdate(setting) }) const rFocus = onFocus(() => { diff --git a/src/renderer/core/useApp/useOpenAPI.ts b/src/renderer/core/useApp/useOpenAPI.ts index e028f57b..0c971fc8 100644 --- a/src/renderer/core/useApp/useOpenAPI.ts +++ b/src/renderer/core/useApp/useOpenAPI.ts @@ -20,11 +20,7 @@ export default () => { openAPI.address = '' openAPI.message = error.message }).finally(() => { - if (openAPI.address) { - setDisableAutoPauseBySource(true, 'openAPI') - } else { - setDisableAutoPauseBySource(false, 'openAPI') - } + setDisableAutoPauseBySource(!!openAPI.address, 'openAPI') }) } watch(() => appSetting['openAPI.enable'], enable => { diff --git a/src/renderer/core/useApp/useStatusbarLyric.ts b/src/renderer/core/useApp/useStatusbarLyric.ts index 6f83bc46..c27bbb97 100644 --- a/src/renderer/core/useApp/useStatusbarLyric.ts +++ b/src/renderer/core/useApp/useStatusbarLyric.ts @@ -1,4 +1,3 @@ -import { watch } from '@common/utils/vueTools' import { appSetting } from '@renderer/store/setting' import { setDisableAutoPauseBySource } from '@renderer/core/lyric' @@ -6,8 +5,11 @@ export default () => { const handleEnable = (enable: boolean) => { setDisableAutoPauseBySource(enable, 'statusBarLyric') } - watch(() => appSetting['player.isShowStatusBarLyric'], enable => { - handleEnable(enable) + + window.app_event.on('configUpdate', (setting) => { + if (setting['player.isShowStatusBarLyric'] != null) { + handleEnable(setting['player.isShowStatusBarLyric']) + } }) return async() => { diff --git a/src/renderer/event/appEvent.ts b/src/renderer/event/appEvent.ts index 1086c5b8..c7a7e21c 100644 --- a/src/renderer/event/appEvent.ts +++ b/src/renderer/event/appEvent.ts @@ -11,8 +11,8 @@ import Event from './Event' // } export class AppEvent extends Event { - configUpdate() { - this.emit('configUpdate') + configUpdate(setting: Partial) { + this.emit('configUpdate', setting) } focus() {