From 061cc16c273692cea48efd8f22895175c9f8f81a Mon Sep 17 00:00:00 2001 From: lyswhut Date: Fri, 30 Aug 2024 20:21:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=98=E7=9B=98=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E9=A2=9C=E8=89=B2=20=E8=B7=9F=E9=9A=8F=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BA=AE=E6=9A=97=E6=A8=A1=E5=BC=8F=20=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=9C=A8=20=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE-=E5=85=B6=E4=BB=96=20=E5=90=AF=E7=94=A8=20=EF=BC=88#2?= =?UTF-8?q?016=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 26 +------------------ src/common/constants.ts | 2 ++ src/lang/en-us.json | 1 + src/lang/zh-cn.json | 1 + src/lang/zh-tw.json | 1 + src/main/modules/tray.ts | 11 +++++++- .../views/Setting/components/SettingOther.vue | 2 ++ 7 files changed, 18 insertions(+), 26 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index e90cd4b2..4c0fb0d8 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,30 +1,6 @@ ### 新增 -- 新增 设置-播放设置-是否将歌词显示在状态栏 设置,默认关闭,该功能只在 MacOS 下可用(#1940) -- 新增设置-播放详情页设置-延迟歌词滚动设置(#1985) -- 新增鼠标在音量按钮使用滚轮时可以调整音量大小的功能(#2000) -- 新增设置-下载设置-同时下载任务数设置(#1498) -- 新增 我的列表-歌曲右击菜单-歌曲换源 功能,换源后下次再播放该列表的该歌曲时将优先尝试播放所选源的歌曲,该功能允许你手动指定来源以解决自动换源失败或者换源不准确的问题 - -### 优化 - -- 优化侧栏图标显示,修复图标可能被裁切的问题(#1960) -- 托盘图标添加当前播放歌曲名字显示 -- 优化本地歌曲内嵌封面过大时的加载方式 -- 将下载歌曲的歌手信息中的分隔符从 `、` 替换为 `;` 以确保音乐元数据在写入时的兼容性和一致性(#1989 @qnnp-me) - -### 修复 - -- 修复 MacOS 下点击 dock 右键菜单的退出按钮时,程序没有退出的问题(#1923) -- 修复 OpenAPI 的 `lyricLineAllText` 在切换到无歌词的音乐时内容没有更新的问题(#1925) -- 修复切换音源时可能出现切换死循环的问题 -- 尝试修复某些情况下播放音频时,处于播放状态但是进度条不走的问题 -- 修复程序目录路径存在 `#` 或 `%` 时,自定义源、托盘等图标异常的问题(#1997) - -### 变更 - -- 简化了应用退出行为,据测试,现在 linux 下,若启用了托盘,dock 右键菜单的 退出、关闭所有 之类的功能将不再退出程序,需改用托盘的退出按钮退出程序 -- 现在如果在设置或者启动参数配置了代理服务,那么应用内的图片、音频加载,歌曲下载也将走代理 +- 新增托盘图标颜色 跟随系统亮暗模式 设置,可以在 设置-其他 启用 (#2016) ### 其他 diff --git a/src/common/constants.ts b/src/common/constants.ts index 5702b50a..5323dbed 100644 --- a/src/common/constants.ts +++ b/src/common/constants.ts @@ -80,3 +80,5 @@ export const DOWNLOAD_STATUS = { } as const export const QUALITYS = ['flac24bit', 'flac', 'wav', 'ape', '320k', '192k', '128k'] as const + +export const TRAY_AUTO_ID = -1 diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 81606d46..3573fe80 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -500,6 +500,7 @@ "setting__other_resource_cache_tip": "Picture, audio, and other caches. After cleaning, resources such as pictures will need to be downloaded again. It is not recommended to clean up. The software will dynamically manage the cache size according to the disk space.", "setting__other_resource_cache_tip_confirm": "Involving the cache of pictures, audios, etc., the pictures and other resources will need to be downloaded again after cleaning. It is not recommended to clean up. The software will dynamically manage the cache size according to the disk space. Do you still need to clean up?", "setting__other_tray_theme": "Tray Icon Style", + "setting__other_tray_theme_auto": "Follow the system light and dark themes", "setting__other_tray_theme_black": "Black Color", "setting__other_tray_theme_native": "White", "setting__other_tray_theme_origin": "Primary Color", diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index 9cec7e4f..7fe6fd0b 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -500,6 +500,7 @@ "setting__other_resource_cache_tip": "图片、音频等缓存,清理后图片等资源将需要重新下载,不建议清理,软件会根据磁盘空间动态管理缓存大小", "setting__other_resource_cache_tip_confirm": "涉及图片、音频等缓存,清理后图片等资源将需要重新下载,不建议清理,软件会根据磁盘空间动态管理缓存大小,是否仍要清理?", "setting__other_tray_theme": "托盘图标样式", + "setting__other_tray_theme_auto": "跟随系统亮暗主题", "setting__other_tray_theme_black": "黑色", "setting__other_tray_theme_native": "白色", "setting__other_tray_theme_origin": "原色", diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 2b14446e..b4be0c78 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -500,6 +500,7 @@ "setting__other_resource_cache_tip": "圖片、音訊等緩存,清理後圖片等資源將需要重新下載,不建議清理,軟體會根據磁碟空間動態管理快取大小", "setting__other_resource_cache_tip_confirm": "涉及圖片、音訊等緩存,清理後圖片等資源將需要重新下載,不建議清理,軟體會根據磁碟空間動態管理快取大小,是否仍要清理?", "setting__other_tray_theme": "托盤圖示樣式", + "setting__other_tray_theme_auto": "跟隨系統亮暗主題", "setting__other_tray_theme_black": "黑色", "setting__other_tray_theme_native": "白色", "setting__other_tray_theme_origin": "原色", diff --git a/src/main/modules/tray.ts b/src/main/modules/tray.ts index 63a62320..8b22bc9c 100644 --- a/src/main/modules/tray.ts +++ b/src/main/modules/tray.ts @@ -9,6 +9,7 @@ import { showWindow as showMainWindow, } from './winMain' import { quitApp } from '@main/app' +import { TRAY_AUTO_ID } from '@common/constants' let tray: Electron.Tray | null let isEnableTray: boolean = false @@ -132,7 +133,10 @@ const i18n = { } const getIconPath = (id: number) => { - let theme = themeList.find(item => item.id === id) ?? themeList[0] + let theme = id == TRAY_AUTO_ID + ? global.lx.theme.shouldUseDarkColors + ? themeList[0] : themeList[2] + : themeList.find(item => item.id === id) ?? themeList[0] return path.join(global.staticPath, 'images/tray', theme.fileName + (isWin ? '.ico' : '.png')) } @@ -372,6 +376,11 @@ export default () => { init() }) + global.lx.event_app.on('system_theme_change', () => { + if (global.lx.appSetting['tray.themeId'] != TRAY_AUTO_ID) return + setTrayImage(global.lx.appSetting['tray.themeId']) + }) + global.lx.event_app.on('player_status', (status) => { let updated = false if (status.status) { diff --git a/src/renderer/views/Setting/components/SettingOther.vue b/src/renderer/views/Setting/components/SettingOther.vue index b7e21d25..2d4a8178 100644 --- a/src/renderer/views/Setting/components/SettingOther.vue +++ b/src/renderer/views/Setting/components/SettingOther.vue @@ -77,6 +77,7 @@ import { appSetting, updateSetting } from '@renderer/store/setting' import { overwriteListFull } from '@renderer/store/list/listManage' import { dislikeRuleCount } from '@renderer/store/dislikeList' import DislikeListModal from './DislikeListModal.vue' +import { TRAY_AUTO_ID } from '@common/constants' export default { name: 'SettingOther', @@ -91,6 +92,7 @@ export default { { id: 0, name: 'native', label: t('setting__other_tray_theme_native') }, { id: 2, name: 'black', label: t('setting__other_tray_theme_black') }, { id: 1, name: 'origin', label: t('setting__other_tray_theme_origin') }, + { id: TRAY_AUTO_ID, name: 'auto', label: t('setting__other_tray_theme_auto') }, ] })