aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/aboutdialog.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-13 12:30:02 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-13 14:21:38 +0200
commitd5134e7176bdc604267ac084a1464bd8eea8bff2 (patch)
tree101dbe8ef8d4af01d2e65ec6474c9038df918235 /ui/aboutdialog.go
parentservice: use more standard naming scheme for syscalls (diff)
downloadwireguard-windows-d5134e7176bdc604267ac084a1464bd8eea8bff2.tar.xz
wireguard-windows-d5134e7176bdc604267ac084a1464bd8eea8bff2.zip
ui: add easter egg
Diffstat (limited to 'ui/aboutdialog.go')
-rw-r--r--ui/aboutdialog.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/aboutdialog.go b/ui/aboutdialog.go
index 1c4528dc..1e1c3c1c 100644
--- a/ui/aboutdialog.go
+++ b/ui/aboutdialog.go
@@ -17,6 +17,8 @@ import (
"golang.zx2c4.com/wireguard/windows/version"
)
+var easterEggIndex = -1
+
func onAbout(owner walk.Form) {
vbl := walk.NewVBoxLayout()
vbl.SetMargins(walk.Margins{80, 20, 80, 20})
@@ -37,6 +39,16 @@ func onAbout(owner walk.Form) {
iv.MouseUp().Attach(func(x, y int, button walk.MouseButton) {
if button == walk.LeftButton {
win.ShellExecute(dlg.Handle(), nil, windows.StringToUTF16Ptr("https://www.wireguard.com/"), nil, nil, win.SW_SHOWNORMAL)
+ } else if easterEggIndex >= 0 && button == walk.RightButton {
+ if icon, err := loadSystemIcon("moricons", int32(easterEggIndex), dlg.DPI()*4/3); err == nil { //TODO: calculate DPI dynamically
+ iv.SetImage(icon)
+ easterEggIndex++
+ } else {
+ easterEggIndex = -1
+ if logo, err := loadLogoIcon(dlg.DPI() * 4 / 3); err == nil { //TODO: calculate DPI dynamically
+ iv.SetImage(logo)
+ }
+ }
}
})
if logo, err := loadLogoIcon(dlg.DPI() * 4 / 3); err == nil { //TODO: calculate DPI dynamically
@@ -74,6 +86,9 @@ func onAbout(owner walk.Form) {
donatePB.SetAlignment(walk.AlignHCenterVNear)
donatePB.SetText("♥ Donate!")
donatePB.Clicked().Attach(func() {
+ if easterEggIndex == -1 {
+ easterEggIndex = 0
+ }
win.ShellExecute(dlg.Handle(), nil, windows.StringToUTF16Ptr("https://www.wireguard.com/donations/"), nil, nil, win.SW_SHOWNORMAL)
dlg.Accept()
})