mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:43:44 +08:00
chore: update
This commit is contained in:
parent
d3123253b3
commit
b1f097f32b
@ -87,6 +87,7 @@ impl Tray {
|
|||||||
let sysproxy_tray_icon = verge.sysproxy_tray_icon.as_ref().unwrap_or(&false);
|
let sysproxy_tray_icon = verge.sysproxy_tray_icon.as_ref().unwrap_or(&false);
|
||||||
let tun_tray_icon = verge.tun_tray_icon.as_ref().unwrap_or(&false);
|
let tun_tray_icon = verge.tun_tray_icon.as_ref().unwrap_or(&false);
|
||||||
let tray = app_handle.tray_by_id("main").unwrap();
|
let tray = app_handle.tray_by_id("main").unwrap();
|
||||||
|
let tray_icon = verge.tray_icon.clone().unwrap_or("monochrome".to_string());
|
||||||
|
|
||||||
let _ = tray.set_menu(Some(create_tray_menu(
|
let _ = tray.set_menu(Some(create_tray_menu(
|
||||||
&app_handle,
|
&app_handle,
|
||||||
@ -98,6 +99,16 @@ impl Tray {
|
|||||||
let mut use_custom_icon = false;
|
let mut use_custom_icon = false;
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
let mut indication_icon = if *system_proxy {
|
let mut indication_icon = if *system_proxy {
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
let mut icon = match tray_icon.as_str() {
|
||||||
|
"colorful" => {
|
||||||
|
use_custom_icon = true;
|
||||||
|
include_bytes!("../../icons/tray-icon-sys.ico").to_vec()
|
||||||
|
}
|
||||||
|
_ => include_bytes!("../../icons/tray-icon-sys-mono.ico").to_vec(),
|
||||||
|
};
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
let mut icon = include_bytes!("../../icons/tray-icon-sys.ico").to_vec();
|
let mut icon = include_bytes!("../../icons/tray-icon-sys.ico").to_vec();
|
||||||
if *sysproxy_tray_icon {
|
if *sysproxy_tray_icon {
|
||||||
let icon_dir_path = dirs::app_home_dir()?.join("icons");
|
let icon_dir_path = dirs::app_home_dir()?.join("icons");
|
||||||
@ -112,6 +123,16 @@ impl Tray {
|
|||||||
}
|
}
|
||||||
icon
|
icon
|
||||||
} else if *tun_mode {
|
} else if *tun_mode {
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
let mut icon = match tray_icon.as_str() {
|
||||||
|
"colorful" => {
|
||||||
|
use_custom_icon = true;
|
||||||
|
include_bytes!("../../icons/tray-icon-tun.ico").to_vec()
|
||||||
|
}
|
||||||
|
_ => include_bytes!("../../icons/tray-icon-tun-mono.ico").to_vec(),
|
||||||
|
};
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
let mut icon = include_bytes!("../../icons/tray-icon-tun.ico").to_vec();
|
let mut icon = include_bytes!("../../icons/tray-icon-tun.ico").to_vec();
|
||||||
if *tun_tray_icon {
|
if *tun_tray_icon {
|
||||||
let icon_dir_path = dirs::app_home_dir()?.join("icons");
|
let icon_dir_path = dirs::app_home_dir()?.join("icons");
|
||||||
@ -126,6 +147,16 @@ impl Tray {
|
|||||||
}
|
}
|
||||||
icon
|
icon
|
||||||
} else {
|
} else {
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
let mut icon = match tray_icon.as_str() {
|
||||||
|
"colorful" => {
|
||||||
|
use_custom_icon = true;
|
||||||
|
include_bytes!("../../icons/tray-icon.ico").to_vec()
|
||||||
|
}
|
||||||
|
_ => include_bytes!("../../icons/tray-icon-mono.ico").to_vec(),
|
||||||
|
};
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
let mut icon = include_bytes!("../../icons/tray-icon.ico").to_vec();
|
let mut icon = include_bytes!("../../icons/tray-icon.ico").to_vec();
|
||||||
if *common_tray_icon {
|
if *common_tray_icon {
|
||||||
let icon_dir_path = dirs::app_home_dir()?.join("icons");
|
let icon_dir_path = dirs::app_home_dir()?.join("icons");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user