From 5cfcc7e6e9ead939ead6e16f50b631f40531c741 Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Wed, 28 Aug 2024 21:53:03 +0800 Subject: [PATCH] adjust tray --- changelog.md | 8 +++----- resources/iconTemplate.png | Bin 3048 -> 5991 bytes resources/iconTemplate@2x.png | Bin 4048 -> 0 bytes src/main/resolve/tray.ts | 2 +- .../src/components/sider/conn-card.tsx | 4 ++-- src/renderer/src/utils/calc.ts | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 resources/iconTemplate@2x.png diff --git a/changelog.md b/changelog.md index c888e04..6e2bf3a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,5 @@ -### New Features - -- 调整UI细节 - ### Bug Fixes -- 修复MacOS托盘绘制网速导致的占用异常 +- 修复MacOS系统代理修改失败的问题 +- 修复Windows URL Scheme失效的问题 +- 修复DNS策略无法删除的问题 diff --git a/resources/iconTemplate.png b/resources/iconTemplate.png index 6212d2a0d1c568b80b3b9688ba90340c4553cf7b..d10e85d77527d522539b825ddcbeefbd7c93333b 100644 GIT binary patch delta 3311 zcmbVP3pmqzA4e<0i3mxZnrTFKXSSJ3*<22D$r7ii*=Ad_i(T5L%Q`M0j-t0*Dh@ev zauOoRoZN~MUA>Vgak>a+^3e6<{VRDo@6-F9=Y9Xrv;Y71|NTF|&-e4aKF^*ldy241 z4GQpHtZ%8WrKPpl*N40jczVqKz>9$UX>RO5rPVQgl{rjH%N(ZdyK#+1OA9p4rG-hu zsQyHTkdL4NnBIR;9LXJfU#cU*+Kp-Gd7$gRxf&&n^L@AKc6>x#X`ZEQY zC1HrUA}LoWfXq_Tql7Z4D-_WB$qT+{o>w55ixdzuq=GI&q7kTBr#=FijCq_$CXV@N zoykD5Vpx2ZKq^71&xT8C22K0aZoLMAs_`By9kPs5;zPR>Lu zfc*jr)Dx2~rT;CM$sk4x#e6#8GM7(hvydVI8w!~ZB+*kPj1h_f%YZ)YM;TNq(N`dm z(gh5bFWD6ec#Yt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G0000G2nGNE03Y-JVX+~b3V#a| z000XU0RWnu7ytkP2}wjjR5*>L(?2LhQ5*;G&(&L$$*LHTVlya|k{Bq9k{FT`pR8{gX=Rf8B>x?x zq%1)l4|py(4`QT%y~sGK#|b{LB_nDv!pATb=?i$pI^JUrZZV2kd_{PpP%ga(y*R^l roL~h*c#}P4E4c_A&0{!e_dEXrGk!FGtRG+p00000NkvXXu0mjf?2U<; diff --git a/resources/iconTemplate@2x.png b/resources/iconTemplate@2x.png deleted file mode 100644 index 47da2ff9d1d02f272f0ba095313251c3a2a8406f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4048 zcmV;>4=?bEP)StO&>uS)ve<0AYj>5AR{$W90N^4L=L-RlQUJ&DC0@ZjPh;=*jPLSYvv5M~MFBAl0-BNIsH z15C~g000{K(ZT*WKal6<?_01!^k@7iDG<<3=fuAC~28EsPoqkpK{9G%|Vj005J}`Hw&=0RYXHq~ibpyyzHQsFW8>#s~laM4*8xut5h5 z!4#~(4xGUqyucR%VFpA%3?#rj5JCpzfE)^;7?wd9RKPme1hudO8lVxH;SjXJF*pt9 z;1XPc>u?taU>Kgl7`%oF1VP9M6Ja4bh!J9r*dopd7nzO(B4J20l7OTj>4+3jBE`sZ zqynizYLQ(?Bl0bB6giDtK>Co|$RIL`{EECsF_eL_Q3KQhbwIhO9~z3rpmWi5G!I>X zmZEFX8nhlgfVQHi(M#xcbO3#dj$?q)F%D*o*1Pf{>6$SWH+$s3q(pv=X`qR|$iJF~TPzlc-O$C3+J1 z#CT#lv5;6stS0Uu9wDA3UMCI{Uz12A4#|?_P6{CkNG+sOq(0IRX`DyT~9-sA|ffUF>wk++Z!kWZ5P$;0Hg6gtI-;!FvmBvPc55=u2?Kjj3apE5$3psG>L zsh-pbs)#zDT1jo7c2F-(3)vyY4>O^>2$gY-Gd%Qm(Z8e zYv>2*=jns=cMJ`N4THx>VkjAF8G9M07`GWOnM|ey)0dgZR4~^v8<}UA514ONSSt1^ zd=-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3$F#@(UpwLoWCRXWGeix&le*?M^`fcdi*xeeClDR2^1v&fGyi6X-Op2b58*o^O zGV9TXtHc^rSpTBCz;IE&Gf78{;Lmuwpxo~0hq;yW&7$UDo~R*em^=nJ1rx+e536eb zT9mCW$)iXE{DJFnt*9lKS~)i8Fh;V2mTG_#MOJr`aF5&hPORPwbl%gO$qrFqF$c$q z4<-|Fu5gB?;irmT^YKY{!rJQn-{81eO9=P3UHF))%WJEIFU$WPr888=k5pYnx>}6P zh2kG3I(5o2z*O;}vz_+gHD6SR@9CVT!x*Pmwa;BVee|U28?&ascH#Rk!t3IL#@@uL z$}v+oO%sGMYQp!rBVb=*e~nP96=*g44bW-@TFrl}qUBV1H5%Rk0000 { tray.setContextMenu(menu) } if (process.platform === 'darwin') { - const icon = nativeImage.createFromPath(templateIcon) + const icon = nativeImage.createFromPath(templateIcon).resize({ height: 16 }) icon.setTemplateImage(true) tray = new Tray(icon) } diff --git a/src/renderer/src/components/sider/conn-card.tsx b/src/renderer/src/components/sider/conn-card.tsx index bb33826..67eee81 100644 --- a/src/renderer/src/components/sider/conn-card.tsx +++ b/src/renderer/src/components/sider/conn-card.tsx @@ -223,7 +223,7 @@ const drawSvg = async (upload: number, download: number): Promise => { if (upload === currentUpload && download === currentDownload) return currentUpload = upload currentDownload = download - const svg = `data:image/svg+xml;utf8,${calcTraffic(upload)}/s${calcTraffic(download)}/s` + const svg = `data:image/svg+xml;utf8,${calcTraffic(upload)}/s${calcTraffic(download)}/s` const image = await loadImage(svg) window.electron.ipcRenderer.send('trayIconUpdate', image) } @@ -247,4 +247,4 @@ const loadImage = (url: string): Promise => { }) } -const trayIconBase64 = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAACklpQ0NQc1JHQiBJRUM2MTk2Ni0yLjEAAEiJnVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkid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zzB9UVc5Y+7dNq/F6QchKHC8swy7cVMl5h4gDNtW9zUkC0rx8oWDxdXiLWOlRUcJ6SJy1dcIEbcHuBnZ7RlF5fG0yjhMO3ZmeiWOII3MTfimOyO3sTcAn8Xnh2u4Uk1yPG8Wkt4tVnksh8BRUZLRjl+PFr8fOrq6XCJI2FlkyxRPcLhqNNooa/zo8ashbu19UsrZ/IndXmpd34ytCcZ8pFObm9vdn1RGaCziQM7sDwf8JmG0BZhv/A8IVUrTbIT6pAAAAAElFTkSuQmCC` diff --git a/src/renderer/src/utils/calc.ts b/src/renderer/src/utils/calc.ts index 6e8db3b..87dd1fe 100644 --- a/src/renderer/src/utils/calc.ts +++ b/src/renderer/src/utils/calc.ts @@ -1,5 +1,5 @@ export function calcTraffic(byte: number): string { - if (byte < 1024) return `${byte} B` + if (byte < 1024) return `${formatNumString(byte)} B` byte /= 1024 if (byte < 1024) return `${formatNumString(byte)} KB` byte /= 1024