fix: tray tooltip not updating

This commit is contained in:
huzibaca
2025-01-13 13:01:12 +08:00
parent 362270e3ea
commit 3ddfbc5d2f
2 changed files with 8 additions and 1 deletions

View File

@@ -205,10 +205,12 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
let mut should_update_systray_icon = false;
let mut should_update_hotkey = false;
let mut should_update_systray_menu = false;
let mut should_update_systray_tooltip = false;
if tun_mode.is_some() {
should_update_clash_config = true;
should_update_systray_menu = true;
should_update_systray_tooltip = true;
#[cfg(target_os = "macos")]
{
should_update_systray_icon = true;
@@ -239,6 +241,7 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
if system_proxy.is_some() {
should_update_sysproxy = true;
should_update_systray_menu = true;
should_update_systray_tooltip = true;
#[cfg(target_os = "macos")]
{
should_update_systray_icon = true;
@@ -292,6 +295,9 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
tray::Tray::global().update_icon(None)?;
}
if should_update_systray_tooltip {
tray::Tray::global().update_tooltip()?;
}
<Result<()>>::Ok(())
};
match res {