diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-13 12:30:02 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-13 14:21:38 +0200 |
commit | 01eb76c55666b78a520a61a0c537a3eb3fa6e640 (patch) | |
tree | 101dbe8ef8d4af01d2e65ec6474c9038df918235 /ui | |
parent | service: use more standard naming scheme for syscalls (diff) | |
download | wireguard-windows-01eb76c55666b78a520a61a0c537a3eb3fa6e640.tar.xz wireguard-windows-01eb76c55666b78a520a61a0c537a3eb3fa6e640.zip |
ui: add easter egg
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aboutdialog.go | 15 |
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() }) |