mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:43:44 +08:00
feat: Support different tray icon for macos
This commit is contained in:
parent
9af1f90990
commit
7de6622d74
BIN
src-tauri/icons/mac-tray-icon-sys.png
Normal file
BIN
src-tauri/icons/mac-tray-icon-sys.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
BIN
src-tauri/icons/mac-tray-icon-tun.png
Normal file
BIN
src-tauri/icons/mac-tray-icon-tun.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user