From 356b27dafbf767cb8157c7051798a28da4b15e61 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sat, 10 Dec 2022 18:45:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=AE=80Windows=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/main.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 4af964e..8c71c30 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -104,15 +104,15 @@ fn main() -> wry::Result<()> { }) .with_inner_size(wry::application::dpi::LogicalSize::new(width, height)); #[cfg(target_os = "windows")] - let icon_path = format!("png/{}_32.ico", package_name); - #[cfg(target_os = "windows")] - let icon = load_icon(std::path::Path::new(&icon_path)); - #[cfg(target_os = "windows")] - let window = common_window - .with_decorations(true) - .with_window_icon(Some(icon)) - .build(&event_loop) - .unwrap(); + let window = { + let icon_path = format!("png/{}_32.ico", package_name); + let icon = load_icon(std::path::Path::new(&icon_path)); + common_window + .with_decorations(true) + .with_window_icon(Some(icon)) + .build(&event_loop) + .unwrap() + }; #[cfg(target_os = "linux")] let window = common_window.build(&event_loop).unwrap();