From a109efc1d6c2f04d22be6d693a868e9a9cd6af2f Mon Sep 17 00:00:00 2001 From: Yu-Haifeng <42990940+Yu-Haifeng@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:42:05 +0800 Subject: [PATCH] fix: macOS tray icon not changed when use system proxy or tun mode (#2176) --- src-tauri/src/core/tray.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/core/tray.rs b/src-tauri/src/core/tray.rs index 7e69c0f9..fc4a82df 100644 --- a/src-tauri/src/core/tray.rs +++ b/src-tauri/src/core/tray.rs @@ -184,12 +184,8 @@ impl Tray { #[cfg(target_os = "macos")] { - if use_custom_icon { - let _ = tray.set_icon_as_template(false); - let _ = tray.set_icon(Some(tauri::image::Image::from_bytes(&indication_icon)?)); - } else { - let _ = tray.set_icon_as_template(true); - } + let _ = tray.set_icon(Some(tauri::image::Image::from_bytes(&indication_icon)?)); + let _ = tray.set_icon_as_template(!use_custom_icon); } #[cfg(not(target_os = "macos"))]