refactor: when updating the tray, the logic is split to improve performance.

This commit is contained in:
huzibaca
2024-12-24 04:52:14 +08:00
parent 0669f7a10b
commit d9291d4f79
4 changed files with 143 additions and 80 deletions

View File

@@ -71,6 +71,21 @@ impl Handle {
Ok(())
}
pub fn update_systray_menu() -> Result<()> {
Tray::update_menu()?;
Ok(())
}
pub fn update_systray_icon() -> Result<()> {
Tray::update_icon()?;
Ok(())
}
pub fn update_systray_tooltip() -> Result<()> {
Tray::update_tooltip()?;
Ok(())
}
pub fn set_is_exiting(&self) {
let mut is_exiting = self.is_exiting.write();
*is_exiting = true;