diff --git a/publish/changeLog.md b/publish/changeLog.md index fe4e6ff3..a5e5268a 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,6 +1,7 @@ ### 新增 - 自定义源新增`version`字段,新增`utils.buffer.bufToString`方法 +- 添加黑色托盘图标 ### 优化 diff --git a/src/main/modules/tray.js b/src/main/modules/tray.js index 183979fa..d6c081cc 100644 --- a/src/main/modules/tray.js +++ b/src/main/modules/tray.js @@ -7,12 +7,17 @@ let themeId = null const themeList = [ { id: 0, - fileName: 'tray0Template', + fileName: 'trayTemplate', isNative: true, }, { id: 1, - fileName: 'tray1Template', + fileName: 'tray_origin', + isNative: false, + }, + { + id: 2, + fileName: 'tray_black', isNative: false, }, ] @@ -43,8 +48,8 @@ const createTray = () => { if ((global.modules.tray && !global.modules.tray.isDestroyed()) || !global.appSetting.tray || !global.appSetting.tray.isShow) return themeId = global.appSetting.tray.themeId - let themeName = (themeList.find(item => item.id === themeId) || themeList[0]).fileName - const iconPath = path.join(global.__static, 'images/tray', themeName + '.png') + let theme = themeList.find(item => item.id === themeId) || themeList[0] + const iconPath = path.join(global.__static, 'images/tray', theme.fileName + '.png') // 托盘 global.modules.tray = new Tray(nativeImage.createFromPath(iconPath)) @@ -140,7 +145,7 @@ const createMenu = tray => { const setTrayImage = themeId => { if (!global.modules.tray) return - let themeName = (themeList.find(item => item.id === themeId) || themeList[0]).fileName - const iconPath = path.join(global.__static, 'images/tray', themeName + '.png') + let theme = themeList.find(item => item.id === themeId) || themeList[0] + const iconPath = path.join(global.__static, 'images/tray', theme.fileName + '.png') global.modules.tray.setImage(nativeImage.createFromPath(iconPath)) } diff --git a/src/renderer/lang/en-us/view/setting.json b/src/renderer/lang/en-us/view/setting.json index ee5b2930..b648ae86 100644 --- a/src/renderer/lang/en-us/view/setting.json +++ b/src/renderer/lang/en-us/view/setting.json @@ -120,6 +120,7 @@ "other_resource_cache_clear_btn": "Clear resource cache", "other_resource_cache_label": "The software has used cache size: ", "other_tray_theme": "Tray Icon Style", + "other_tray_theme_black": "Black Color", "other_tray_theme_native": "Solid Color", "other_tray_theme_origin": "Primary Color", "play": "Play", diff --git a/src/renderer/lang/zh-cn/view/setting.json b/src/renderer/lang/zh-cn/view/setting.json index 9b01c238..944cd47d 100644 --- a/src/renderer/lang/zh-cn/view/setting.json +++ b/src/renderer/lang/zh-cn/view/setting.json @@ -120,6 +120,7 @@ "other_resource_cache_clear_btn": "清理资源缓存", "other_resource_cache_label": "软件已使用缓存大小:", "other_tray_theme": "托盘图标样式", + "other_tray_theme_black": "黑色", "other_tray_theme_native": "纯色", "other_tray_theme_origin": "原色", "play": "播放设置", diff --git a/src/renderer/lang/zh-tw/view/setting.json b/src/renderer/lang/zh-tw/view/setting.json index 95e523a0..9297c126 100644 --- a/src/renderer/lang/zh-tw/view/setting.json +++ b/src/renderer/lang/zh-tw/view/setting.json @@ -120,6 +120,7 @@ "other_resource_cache_clear_btn": "清理資源緩存", "other_resource_cache_label": "軟件已使用緩存大小:", "other_tray_theme": "托盤圖標樣式", + "other_tray_theme_black": "黑色", "other_tray_theme_native": "純色", "other_tray_theme_origin": "原色", "play": "播放設置", diff --git a/src/renderer/views/Setting.vue b/src/renderer/views/Setting.vue index abd6312a..143ec40e 100644 --- a/src/renderer/views/Setting.vue +++ b/src/renderer/views/Setting.vue @@ -455,6 +455,10 @@ export default { id: 1, name: 'origin', }, + { + id: 2, + name: 'black', + }, ] }, syncEnableTitle() { diff --git a/src/static/images/tray/tray0Template.png b/src/static/images/tray/trayTemplate.png similarity index 100% rename from src/static/images/tray/tray0Template.png rename to src/static/images/tray/trayTemplate.png diff --git a/src/static/images/tray/tray0Template@1.25x.png b/src/static/images/tray/trayTemplate@1.25x.png similarity index 100% rename from src/static/images/tray/tray0Template@1.25x.png rename to src/static/images/tray/trayTemplate@1.25x.png diff --git a/src/static/images/tray/tray0Template@1.5x.png b/src/static/images/tray/trayTemplate@1.5x.png similarity index 100% rename from src/static/images/tray/tray0Template@1.5x.png rename to src/static/images/tray/trayTemplate@1.5x.png diff --git a/src/static/images/tray/tray0Template@2x.png b/src/static/images/tray/trayTemplate@2x.png similarity index 100% rename from src/static/images/tray/tray0Template@2x.png rename to src/static/images/tray/trayTemplate@2x.png diff --git a/src/static/images/tray/tray_black.png b/src/static/images/tray/tray_black.png new file mode 100644 index 00000000..ec0d2051 Binary files /dev/null and b/src/static/images/tray/tray_black.png differ diff --git a/src/static/images/tray/tray_black@1.25x.png b/src/static/images/tray/tray_black@1.25x.png new file mode 100644 index 00000000..1eb89847 Binary files /dev/null and b/src/static/images/tray/tray_black@1.25x.png differ diff --git a/src/static/images/tray/tray_black@1.5x.png b/src/static/images/tray/tray_black@1.5x.png new file mode 100644 index 00000000..c40ebd7b Binary files /dev/null and b/src/static/images/tray/tray_black@1.5x.png differ diff --git a/src/static/images/tray/tray_black@2x.png b/src/static/images/tray/tray_black@2x.png new file mode 100644 index 00000000..79216573 Binary files /dev/null and b/src/static/images/tray/tray_black@2x.png differ diff --git a/src/static/images/tray/tray1Template.ico b/src/static/images/tray/tray_origin.ico similarity index 100% rename from src/static/images/tray/tray1Template.ico rename to src/static/images/tray/tray_origin.ico diff --git a/src/static/images/tray/tray1Template.png b/src/static/images/tray/tray_origin.png similarity index 100% rename from src/static/images/tray/tray1Template.png rename to src/static/images/tray/tray_origin.png diff --git a/src/static/images/tray/tray1Template@2x.ico b/src/static/images/tray/tray_origin@2x.ico similarity index 100% rename from src/static/images/tray/tray1Template@2x.ico rename to src/static/images/tray/tray_origin@2x.ico diff --git a/src/static/images/tray/tray1Template@2x.png b/src/static/images/tray/tray_origin@2x.png similarity index 100% rename from src/static/images/tray/tray1Template@2x.png rename to src/static/images/tray/tray_origin@2x.png