feat: add dynamic tray menu with connection status, transfer metrics, and toggle action

Add TrayState struct to track menu items for status, received/sent bytes, and connection toggle. Add format_data_size helper to convert bytes to human-readable units (B, KB, MB, GB, TB). Add current_metrics, update_tray_menu, refresh_tray_menu, and toggle_tray_connection functions to manage tray state. Update tray menu to include status, received, sent, and toggle items. Call refresh_tray_menu after enroll_device
This commit is contained in:
2026-03-18 08:45:06 +01:00
parent a87a4664be
commit cb79bdafbd
4 changed files with 162 additions and 18 deletions

View File

@@ -735,6 +735,7 @@ fn read_transfer_totals(profile: &Path) -> Result<(u64, u64), String> {
#[cfg(target_os = "windows")]
fn find_wg_cli() -> Result<PathBuf, String> {
let candidates = [
PathBuf::from("wg"),
PathBuf::from(r"C:\Program Files\WireGuard\wg.exe"),
PathBuf::from(r"C:\Program Files (x86)\WireGuard\wg.exe"),
];