feat: Set different tray icon on tun mode (#33)

好看!
This commit is contained in:
Pylogmon
2023-11-30 01:29:11 +08:00
committed by GitHub
Unverified
parent 56a59d25df
commit 0759e17295
2 changed files with 5 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -145,12 +145,16 @@ impl Tray {
#[cfg(target_os = "windows")]
{
let indication_icon = if *system_proxy {
let mut indication_icon = if *system_proxy {
include_bytes!("../../icons/win-tray-icon-activated.png").to_vec()
} else {
include_bytes!("../../icons/win-tray-icon.png").to_vec()
};
if *tun_mode {
indication_icon = include_bytes!("../../icons/win-tray-icon-tun.png").to_vec();
}
let _ = tray.set_icon(tauri::Icon::Raw(indication_icon));
}