diff --git a/UPDATELOG.md b/UPDATELOG.md index db66d403..d807b1d2 100644 --- a/UPDATELOG.md +++ b/UPDATELOG.md @@ -1,9 +1,20 @@ -## v2.1.0 +## v2.1.1 **发行代号:臻** 代号释义: 千锤百炼臻至善,集性能跃升、功能拓展、交互焕新于一体,彰显持续打磨、全方位优化的迭代精神。 +感谢 Tychristine 对社区群组管理做出的重大贡献! + +2.1.1相对2.1.0(已下架不在提供)更新了: + +- MacOS下支持彩色托盘图标和更好速率显示(感谢Tunglies) +- 文件类型判断不准导致脚本检测报错的问题 +- 打开Win下的阴影(Win10因底层兼容性问题,可能圆角和边框显示不太完美) +- 边框去白边 +- 修复Linux下编译问题 +- 修复热键无法关闭面板的问题 + ### 功能新增 - 新增窗口状态实时监控与自动保存功能 @@ -24,12 +35,12 @@ - 重构代理列表渲染逻辑,提升布局计算效率 - 优化代理数据更新机制,采用乐观UI策略 - 改进虚拟列表渲染性能(Virtuoso) -- 提升主窗口Clash模式切换速度 (感谢Tunglies) +- 提升主窗口Clash模式切换速度(感谢Tunglies) - 加速内核关闭流程并优化管理逻辑 - 优化节点延迟刷新速率 - 改进托盘网速显示更新逻辑 - 提升配置验证错误信息的可读性 -- 重构服务架构,优化代码组织结构 (感谢Tunglies) +- 重构服务架构,优化代码组织结构(感谢Tunglies) - 优化内核启动时的配置验证流程 ### 问题修复 diff --git a/package.json b/package.json index d33a4217..4a288186 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clash-verge", - "version": "2.1.0", + "version": "2.1.1", "license": "GPL-3.0-only", "scripts": { "dev": "cross-env RUST_BACKTRACE=1 tauri dev", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 120b8e3d..b001f532 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,8 +62,8 @@ importers: specifier: 2.2.0 version: 2.2.0 "@tauri-apps/plugin-updater": - specifier: 2.4.0 - version: 2.4.0 + specifier: 2.3.0 + version: 2.3.0 "@types/json-schema": specifier: ^7.0.15 version: 7.0.15 @@ -2291,10 +2291,10 @@ packages: integrity: sha512-iC3Ic1hLmasoboG7BO+7p+AriSoqAwKrIk+Hpk+S/bjTQdXqbl2GbdclghI4gM32X0bls7xHzIFqhRdrlvJeaA==, } - "@tauri-apps/plugin-updater@2.4.0": + "@tauri-apps/plugin-updater@2.3.0": resolution: { - integrity: sha512-BkeKN2WObAjobf2G77HyW/DxAfI0In+VSqWGnw/0cVPlM+VmA7fw9dKUnSunryZOG7ys9y07tj7FQa1ABMXGZQ==, + integrity: sha512-qdzyZEUN69FZQ/nRx51fBub10tT6wffJl3DLVo9q922Gvw8Wk++rZhoD9eethPlZYbog/7RGgT8JkrfLh5BKAg==, } "@types/babel__core@7.20.5": @@ -6279,7 +6279,7 @@ snapshots: dependencies: "@tauri-apps/api": 2.2.0 - "@tauri-apps/plugin-updater@2.4.0": + "@tauri-apps/plugin-updater@2.3.0": dependencies: "@tauri-apps/api": 2.2.0 diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 04af60fd..054aef07 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -999,7 +999,7 @@ dependencies = [ [[package]] name = "clash-verge" -version = "2.1.0" +version = "2.1.1" dependencies = [ "aes-gcm", "anyhow", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 255fc43f..c82c6d5d 100755 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clash-verge" -version = "2.1.0" +version = "2.1.1" description = "clash verge" authors = ["zzzgydi", "wonfen", "MystiPanda"] license = "GPL-3.0-only" diff --git a/src-tauri/assets/fonts/FiraCode-Medium.ttf b/src-tauri/assets/fonts/FiraCode-Medium.ttf deleted file mode 100644 index 2c0ecdf1..00000000 Binary files a/src-tauri/assets/fonts/FiraCode-Medium.ttf and /dev/null differ diff --git a/src-tauri/src/core/tray/speed_rate.rs b/src-tauri/src/core/tray/speed_rate.rs index 446f0bed..fd09d127 100644 --- a/src-tauri/src/core/tray/speed_rate.rs +++ b/src-tauri/src/core/tray/speed_rate.rs @@ -78,9 +78,8 @@ impl SpeedRate { let is_colorful = !crate::utils::help::is_monochrome_image_from_bytes(&icon_bytes).unwrap_or(false); // 增加文本宽度和间距 - let icon_text_gap = 80; // 增加图标和文本之间的间距 - let text_width = 520; // 增加文本区域宽度,确保能显示完整 - let total_width = icon_width + icon_text_gap + text_width; + let text_width = 580; // 文本区域宽度 + let total_width = icon_width + text_width; // 创建新的透明画布 let mut combined_image = RgbaImage::new(total_width, icon_height); @@ -112,11 +111,19 @@ impl SpeedRate { let down_text = format_bytes_speed(rate.down); // 计算文本位置,确保垂直间距合适 - let text_x = icon_width + icon_text_gap; - let up_y = 0; - let down_y_offset = 32 as i32; - let down_y = icon_height as i32 - font_size as i32 + down_y_offset; // 下行速率显示在下方 - + // 修改文本位置为居右显示 + let up_text_width = imageproc::drawing::text_size(scale, &font, &up_text).0 as u32; + let down_text_width = imageproc::drawing::text_size(scale, &font, &down_text).0 as u32; + + // 计算右对齐的文本位置 + let up_text_x = total_width - up_text_width; + let down_text_x = total_width - down_text_width; + + // 优化垂直位置,使速率显示的高度和上下间距正好等于图标大小 + let text_height = font_size as i32; + let total_text_height = text_height * 2; + let up_y = (icon_height as i32 - total_text_height) / 2; + let down_y = up_y + text_height; // 绘制速率文本(先阴影后文字) let shadow_offset = 1; @@ -125,7 +132,7 @@ impl SpeedRate { draw_text_mut( &mut combined_image, shadow_color, - text_x as i32 + shadow_offset, + up_text_x as i32 + shadow_offset, up_y + shadow_offset, scale, &font, @@ -134,7 +141,7 @@ impl SpeedRate { draw_text_mut( &mut combined_image, text_color, - text_x as i32, + up_text_x as i32, up_y, scale, &font, @@ -145,7 +152,7 @@ impl SpeedRate { draw_text_mut( &mut combined_image, shadow_color, - text_x as i32 + shadow_offset, + down_text_x as i32 + shadow_offset, down_y + shadow_offset, scale, &font, @@ -154,7 +161,7 @@ impl SpeedRate { draw_text_mut( &mut combined_image, text_color, - text_x as i32, + down_text_x as i32, down_y, scale, &font, diff --git a/src-tauri/src/utils/resolve.rs b/src-tauri/src/utils/resolve.rs index 9203d4c0..8bf402ba 100644 --- a/src-tauri/src/utils/resolve.rs +++ b/src-tauri/src/utils/resolve.rs @@ -161,7 +161,7 @@ pub fn create_window() { .maximizable(true) .additional_browser_args("--enable-features=msWebView2EnableDraggableRegions --disable-features=OverscrollHistoryNavigation,msExperimentalScrolling") .transparent(true) - .shadow(false) + .shadow(true) .build(); #[cfg(target_os = "macos")] diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2bae186c..b3cbf09b 100755 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -25,7 +25,7 @@ "devUrl": "http://localhost:3000/" }, "productName": "Clash Verge", - "version": "2.1.0", + "version": "2.1.1", "identifier": "io.github.clash-verge-rev.clash-verge-rev", "plugins": { "deep-link": { diff --git a/src/assets/styles/layout.scss b/src/assets/styles/layout.scss index 34a6665e..b5eb3cbb 100644 --- a/src/assets/styles/layout.scss +++ b/src/assets/styles/layout.scss @@ -111,7 +111,7 @@ position: absolute; top: 0; left: 0; - right: 2px; + right: 0px; bottom: 0px; } } diff --git a/src/pages/_layout.tsx b/src/pages/_layout.tsx index e2be69d1..4de05ff0 100644 --- a/src/pages/_layout.tsx +++ b/src/pages/_layout.tsx @@ -204,9 +204,9 @@ const Layout = () => { ({ palette }) => ({ bgcolor: palette.background.paper }), { borderRadius: "8px", - border: "2px solid var(--divider-color)", - width: "calc(100vw - 4px)", - height: "calc(100vh - 4px)", + border: "0px solid var(--divider-color)", + width: "calc(100vw - 1px)", + height: "calc(100vh - 1px)", }, ]} >