mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
feat: system tray add tun mode
This commit is contained in:
@@ -337,15 +337,6 @@ pub fn patch_verge_config(
|
||||
let mut verge = verge_state.0.lock().unwrap();
|
||||
wrap_err!(verge.patch_config(payload))?;
|
||||
|
||||
// change system tray
|
||||
if system_proxy.is_some() {
|
||||
app_handle
|
||||
.tray_handle()
|
||||
.get_item("system_proxy")
|
||||
.set_selected(system_proxy.unwrap())
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
// change tun mode
|
||||
if tun_mode.is_some() {
|
||||
#[cfg(target_os = "windows")]
|
||||
@@ -363,6 +354,11 @@ pub fn patch_verge_config(
|
||||
wrap_err!(clash.activate_enhanced(&profiles, false, false))?;
|
||||
}
|
||||
|
||||
// change system tray
|
||||
if system_proxy.is_some() || tun_mode.is_some() {
|
||||
verge.update_systray(&app_handle).unwrap();
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user