From cdbcae21ac7c74f9ebecc7843c61ed4574e3e994 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Wed, 27 Oct 2021 17:11:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=BB=91=E8=89=B2=E6=89=98?= =?UTF-8?q?=E7=9B=98=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/main/modules/tray.js | 17 +++++++++++------ src/renderer/lang/en-us/view/setting.json | 1 + src/renderer/lang/zh-cn/view/setting.json | 1 + src/renderer/lang/zh-tw/view/setting.json | 1 + src/renderer/views/Setting.vue | 4 ++++ .../{tray0Template.png => trayTemplate.png} | Bin ...mplate@1.25x.png => trayTemplate@1.25x.png} | Bin ...Template@1.5x.png => trayTemplate@1.5x.png} | Bin ...ray0Template@2x.png => trayTemplate@2x.png} | Bin src/static/images/tray/tray_black.png | Bin 0 -> 323 bytes src/static/images/tray/tray_black@1.25x.png | Bin 0 -> 410 bytes src/static/images/tray/tray_black@1.5x.png | Bin 0 -> 446 bytes src/static/images/tray/tray_black@2x.png | Bin 0 -> 577 bytes .../{tray1Template.ico => tray_origin.ico} | Bin .../{tray1Template.png => tray_origin.png} | Bin ...tray1Template@2x.ico => tray_origin@2x.ico} | Bin ...tray1Template@2x.png => tray_origin@2x.png} | Bin 18 files changed, 19 insertions(+), 6 deletions(-) rename src/static/images/tray/{tray0Template.png => trayTemplate.png} (100%) rename src/static/images/tray/{tray0Template@1.25x.png => trayTemplate@1.25x.png} (100%) rename src/static/images/tray/{tray0Template@1.5x.png => trayTemplate@1.5x.png} (100%) rename src/static/images/tray/{tray0Template@2x.png => trayTemplate@2x.png} (100%) create mode 100644 src/static/images/tray/tray_black.png create mode 100644 src/static/images/tray/tray_black@1.25x.png create mode 100644 src/static/images/tray/tray_black@1.5x.png create mode 100644 src/static/images/tray/tray_black@2x.png rename src/static/images/tray/{tray1Template.ico => tray_origin.ico} (100%) rename src/static/images/tray/{tray1Template.png => tray_origin.png} (100%) rename src/static/images/tray/{tray1Template@2x.ico => tray_origin@2x.ico} (100%) rename src/static/images/tray/{tray1Template@2x.png => tray_origin@2x.png} (100%) 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 0000000000000000000000000000000000000000..ec0d205102b09dbf61a5f1a64a0a88fe6814b0c9 GIT binary patch literal 323 zcmV-J0lfZ+P)N zbaif>Zs)#NJoO#!bDrlp-*e9QYJ*#R;u=jXv=gWBm8eH-p!2T*d0nCYpMb1dnW&>8 zAj3`AaRSTei8Ld>>EI~hhHw|H&DN^UQNS~{0`-BXst(@KzySIKUk_`|qG1fjxWs7? z?cgD5`2h2{M{j283g$(eqpuM9g30K69D`U1L-rGpy~IhvT!vQ6*TVCR7Q`1=O#}>M z9nml%?4{JHWVwaL*i*FGW VTL}K~hD-ne002ovPDHLkV1lh2lNbO1 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..1eb8984714a5a2d1aa45ba59bc72d94ba6549035 GIT binary patch literal 410 zcmV;L0cHM)P)ju zqX->TC@6|nTES~c$pa6Ut-BV^p83;cl$aU|V5&`M|&vd_+go{ZAZKoT3HGslaY5#M3tLEow7{uO+SS zqJ}}sYrIRr-r{ejfcp}@H4I}V1sjQ{=6*yD*p8+$sL-&IsmWjX9?K(TSGB(453VL2 z=r(qi@DTlYU9;X4n?un3M=i9PNGV7#fc*vyVm@{CgUseb^wxoX$Vl=3ALee5gJxkx z+MxxdfFbo!bYd_17VE*v(8-v7fZX6SUX}K=q9;qhKT%4GyNGX7{Qv*}07*qoM6N<$ Ef=bJ|>;M1& literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..c40ebd7ba20084f5f3972a9361c070a37e1288b9 GIT binary patch literal 446 zcmV;v0YUzWP)>`{7%X(Py^g2{MIP)4t)60docm+$|94J|fpwSh9 zYnCKu{17l1LEhpk!*IlhBqS0fM@PnKgvfwHq#(ILD{v7IxCT1Zc}yRq1QkVYP!G%i oR~oVWO1r;P)DU#5TA1jL8SeQmE42d<#EToi4DaAzo1Pe4578uD0^i@BXj6b_HwIE4#1j;*;w zq3##qD83hj{l-nqiMdAN?;o)`h4@@-ne7@$EBd!MQ4dHllOPUK5*Ke3ZdmTXDU zjzpikIN6DOF7DN6rF8_1R*~i#(TP|t(}7l1&c59BbPeJ#<$P;W=uqOaUoV;QQnsKH zv*LrpxRM}rCAP=X%T{l=jsG*eiT5utR&?l(*98gW0V`tJ4JVG>8>0ohXy;+l0B#?q9b{RR*g4G6_HFHusIG6O^K*Qo?)zpfOl9Q zBF_;1kX3VBW{-2^8Ft|sCjN&!LpamJ_gt84!`Dn84doZk@4_uY%#JK P00000NkvXXu0mjf73mD= literal 0 HcmV?d00001 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