diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-06-27 16:10:28 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-07-29 01:31:39 +0200 |
commit | 45feabe822cd0fbd85224cc2f2a9e8f4c678c98e (patch) | |
tree | 5e134383b9067822d62b9b0219c4ca9862b4f7bf | |
parent | updater: use correct constant for authentication verification and free (diff) | |
download | wireguard-windows-45feabe822cd0fbd85224cc2f2a9e8f4c678c98e.tar.xz wireguard-windows-45feabe822cd0fbd85224cc2f2a9e8f4c678c98e.zip |
ui: account for shield icon move in recent insider builds
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | ui/iconprovider.go | 8 | ||||
-rw-r--r-- | ui/tray.go | 4 | ||||
-rw-r--r-- | ui/updatepage.go | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/ui/iconprovider.go b/ui/iconprovider.go index e3f810e3..18db0eaa 100644 --- a/ui/iconprovider.go +++ b/ui/iconprovider.go @@ -121,6 +121,14 @@ func loadSystemIcon(dll string, index int32, size int) (icon *walk.Icon, err err return } +func loadShieldIcon(size int) (icon *walk.Icon, err error) { + icon, err = loadSystemIcon("imageres", -1028, size) + if err != nil { + icon, err = loadSystemIcon("imageres", 1, size) + } + return +} + var cachedLogoIconsForWidth = make(map[int]*walk.Icon) func loadLogoIcon(size int) (icon *walk.Icon, err error) { @@ -343,7 +343,7 @@ func (tray *Tray) setTunnelState(tunnel *manager.Tunnel, state manager.TunnelSta func (tray *Tray) UpdateFound() { action := walk.NewAction() action.SetText(l18n.Sprintf("An Update is Available!")) - menuIcon, _ := loadSystemIcon("imageres", 1, 16) + menuIcon, _ := loadShieldIcon(16) action.SetImage(menuIcon) action.SetDefault(true) showUpdateTab := func() { @@ -358,7 +358,7 @@ func (tray *Tray) UpdateFound() { tray.ContextMenu().Actions().Insert(tray.ContextMenu().Actions().Len()-2, action) showUpdateBalloon := func() { - icon, _ := loadSystemIcon("imageres", 1, 128) + icon, _ := loadShieldIcon(128) tray.ShowCustom(l18n.Sprintf("WireGuard Update Available"), l18n.Sprintf("An update to WireGuard is now available. You are advised to update as soon as possible."), icon) } diff --git a/ui/updatepage.go b/ui/updatepage.go index 88992ced..cb76da6f 100644 --- a/ui/updatepage.go +++ b/ui/updatepage.go @@ -31,7 +31,7 @@ func NewUpdatePage() (*UpdatePage, error) { up.SetTitle(l18n.Sprintf("An Update is Available!")) - tabIcon, _ := loadSystemIcon("imageres", 1, 16) + tabIcon, _ := loadShieldIcon(16) up.SetImage(tabIcon) up.SetLayout(walk.NewVBoxLayout()) |