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 6212d2a..d10e85d 100644 Binary files a/resources/iconTemplate.png and b/resources/iconTemplate.png differ diff --git a/resources/iconTemplate@2x.png b/resources/iconTemplate@2x.png deleted file mode 100644 index 47da2ff..0000000 Binary files a/resources/iconTemplate@2x.png and /dev/null differ diff --git a/src/main/resolve/tray.ts b/src/main/resolve/tray.ts index d6a1bc7..5196512 100644 --- a/src/main/resolve/tray.ts +++ b/src/main/resolve/tray.ts @@ -224,7 +224,7 @@ export async function createTray(): Promise { 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/xhBQAACklpQ0NQc1JHQiB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5ZrPYqMenHq4fdid/j1kF5h51QLcaJwpE6RZjFdsf4TtWOEL0Ld+2PjCkEVO1sRwuX8lS8SdjMUeFb3yds9i24Wbib49gzzB9UVc5Y+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