From d81e56b2c15a1e5534a3e3513e5a248baa077cd8 Mon Sep 17 00:00:00 2001 From: echocde <70051971+echocde@users.noreply.github.com> Date: Thu, 25 Jun 2026 12:51:02 +0800 Subject: [PATCH] fix(ui): macOS tray icon color invert with system theme (#1783) * fix(UI): Fix macOS tray icon color not automatically inverting with system theme. * Delete unused assets --------- Co-authored-by: Echocde --- src-tauri/src/lib.rs | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 6bb516fd7..4ed76241a 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -113,14 +113,7 @@ fn setup_desktop_tray>( TrayIconBuilder::::with_id(DESKTOP_TRAY_ID).tooltip("DBX").menu(&menu).show_menu_on_left_click(false); #[cfg(target_os = "macos")] { - match _icon_theme { - DesktopIconTheme::Default => { - tray = tray.icon(MACOS_TRAY_ICON).icon_as_template(true); - } - DesktopIconTheme::Black => { - tray = tray.icon(BLACK_APP_ICON).icon_as_template(false); - } - } + tray = tray.icon(MACOS_TRAY_ICON).icon_as_template(true); } #[cfg(target_os = "windows")] { @@ -172,19 +165,6 @@ fn apply_desktop_icon_theme(app: &tauri::AppHandle, icon_theme: DesktopIconTheme fn apply_desktop_tray_icon_theme(app: &tauri::AppHandle, icon_theme: DesktopIconTheme) -> tauri::Result<()> { if let Some(tray) = app.tray_by_id(DESKTOP_TRAY_ID) { - #[cfg(target_os = "macos")] - { - match icon_theme { - DesktopIconTheme::Default => { - tray.set_icon(Some(MACOS_TRAY_ICON))?; - tray.set_icon_as_template(true)?; - } - DesktopIconTheme::Black => { - tray.set_icon(Some(BLACK_APP_ICON))?; - tray.set_icon_as_template(false)?; - } - } - } #[cfg(target_os = "windows")] { let icon = match icon_theme {