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 <udixt@outlook.com>
This commit is contained in:
echocde 2026-06-25 12:51:02 +08:00 committed by GitHub
parent 1ce85b647e
commit d81e56b2c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 21 deletions

View File

@ -113,14 +113,7 @@ fn setup_desktop_tray<R: tauri::Runtime, M: Manager<R>>(
TrayIconBuilder::<R>::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 {