mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
feat: Support different tray icon for macos
This commit is contained in:
@@ -136,13 +136,21 @@ impl Tray {
|
||||
let tun_mode = verge.enable_tun_mode.as_ref().unwrap_or(&false);
|
||||
|
||||
let mut indication_icon = if *system_proxy {
|
||||
include_bytes!("../../icons/tray-icon-activated.png").to_vec()
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
let icon = include_bytes!("../../icons/tray-icon-sys.png").to_vec();
|
||||
#[cfg(target_os = "macos")]
|
||||
let icon = include_bytes!("../../icons/mac-tray-icon-sys.png").to_vec();
|
||||
icon
|
||||
} else {
|
||||
include_bytes!("../../icons/tray-icon.png").to_vec()
|
||||
};
|
||||
|
||||
if *tun_mode {
|
||||
indication_icon = include_bytes!("../../icons/tray-icon-tun.png").to_vec();
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
let icon = include_bytes!("../../icons/tray-icon-tun.png").to_vec();
|
||||
#[cfg(target_os = "macos")]
|
||||
let icon = include_bytes!("../../icons/mac-tray-icon-tun.png").to_vec();
|
||||
indication_icon = icon
|
||||
}
|
||||
|
||||
let _ = tray.set_icon(tauri::Icon::Raw(indication_icon));
|
||||
|
||||
Reference in New Issue
Block a user