From 3dea9a4ac612fb7790fce6d1182455437bd8eea4 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 4 May 2019 10:01:00 +0200 Subject: ui: show custom connected and disconnected icons in balloon --- ui/tray.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/tray.go b/ui/tray.go index 4a11984a..3fed2114 100644 --- a/ui/tray.go +++ b/ui/tray.go @@ -255,6 +255,8 @@ func (tray *Tray) SetTunnelState(tunnel *service.Tunnel, state service.TunnelSta wasChecked := tunnelAction.Checked() + icon, _ := iconProvider.IconWithOverlayForState(state) + switch state { case service.TunnelStarted: activeCIDRsAction.SetText("") @@ -277,13 +279,13 @@ func (tray *Tray) SetTunnelState(tunnel *service.Tunnel, state service.TunnelSta tunnelAction.SetEnabled(true) tunnelAction.SetChecked(true) if !wasChecked && showNotifications { - tray.ShowInfo("WireGuard Activated", fmt.Sprintf("The %s tunnel has been activated.", tunnel.Name)) + tray.ShowCustom("WireGuard Activated", fmt.Sprintf("The %s tunnel has been activated.", tunnel.Name), icon) } case service.TunnelStopped: tunnelAction.SetChecked(false) if wasChecked && showNotifications { - tray.ShowInfo("WireGuard Deactivated", fmt.Sprintf("The %s tunnel has been deactivated.", tunnel.Name)) + tray.ShowCustom("WireGuard Deactivated", fmt.Sprintf("The %s tunnel has been deactivated.", tunnel.Name), icon) } } } -- cgit v1.2.3-59-g8ed1b