From 45d7652c43e347e4ee4b133f6111fe7c9ada6aa1 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Sat, 7 Jan 2023 21:09:59 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E4=BB=A5=E5=8F=8Awindows=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/rust-code-quality-check.yml | 2 +- src-tauri/src/main.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust-code-quality-check.yml b/.github/workflows/rust-code-quality-check.yml index a04433c..366053f 100644 --- a/.github/workflows/rust-code-quality-check.yml +++ b/.github/workflows/rust-code-quality-check.yml @@ -38,7 +38,7 @@ jobs: tool: cargo-hack,nextest - name: Install dependencies for Ubuntu if: matrix.os == 'ubuntu-latest' - uses: awalsh128/cache-apt-pkgs-action@latest + uses: awalsh128/cache-apt-pkgs-action@1.2.0 with: packages: > libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index fe8714b..f8c4cba 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -93,9 +93,14 @@ fn main() -> wry::Result<()> { None }) .with_inner_size(wry::application::dpi::LogicalSize::new(width, height)); + #[cfg(target_os = "windows")] let window = { let icon_path = format!("png/{}_32.ico", package_name); + // 假如没有设置,就使用默认的即可 + if !std::path::Path::new(&icon_path).exists() { + icon_path = "png/icon_32.ico"; + } let icon = load_icon(std::path::Path::new(&icon_path)); common_window .with_decorations(true)