aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-04 00:36:44 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-04 00:41:12 +0200
commite1754d6fe872bb20189a5e93f7bca0f8547e167a (patch)
treee47ebaf2ff5d4e98a02d1e70d511bf2f6899bc10 /ui
parentversion: expose OsVersion for firewall (diff)
downloadwireguard-windows-e1754d6fe872bb20189a5e93f7bca0f8547e167a.tar.xz
wireguard-windows-e1754d6fe872bb20189a5e93f7bca0f8547e167a.zip
ui: specify default action in tray
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/tray.go5
-rw-r--r--ui/tunnelspage.go1
2 files changed, 4 insertions, 2 deletions
diff --git a/ui/tray.go b/ui/tray.go
index 44d63d2b..4a11984a 100644
--- a/ui/tray.go
+++ b/ui/tray.go
@@ -63,12 +63,13 @@ func (tray *Tray) setup() error {
enabled bool
hidden bool
separator bool
+ defawlt bool
}{
{label: "Status: Unknown"},
{label: "Networks: None", hidden: true},
{separator: true},
{separator: true},
- {label: "&Manage tunnels...", handler: tray.onManageTunnels, enabled: true},
+ {label: "&Manage tunnels...", handler: tray.onManageTunnels, enabled: true, defawlt: true},
{label: "&Import tunnel(s) from file...", handler: tray.mtw.tunnelsPage.onImport, enabled: true},
{separator: true},
{label: "&About WireGuard", handler: func() { onAbout(tray.mtw) }, enabled: true},
@@ -82,6 +83,7 @@ func (tray *Tray) setup() error {
action.SetText(item.label)
action.SetEnabled(item.enabled)
action.SetVisible(!item.hidden)
+ action.SetDefault(item.defawlt)
if item.handler != nil {
action.Triggered().Attach(item.handler)
}
@@ -292,7 +294,6 @@ func (tray *Tray) UpdateFound() {
if icon, err := iconProvider.UpdateAvailableImage(); err == nil {
action.SetImage(icon)
}
- //TODO: Make bold
action.Triggered().Attach(func() {
tray.mtw.Show()
tray.mtw.tabs.SetCurrentIndex(2)
diff --git a/ui/tunnelspage.go b/ui/tunnelspage.go
index 18e9e255..dc86d776 100644
--- a/ui/tunnelspage.go
+++ b/ui/tunnelspage.go
@@ -134,6 +134,7 @@ func (tp *TunnelsPage) CreateToolbar() {
importActionImage, _ := walk.NewBitmapFromIcon(importActionIcon, imageSize)
importAction.SetImage(importActionImage)
importAction.SetShortcut(walk.Shortcut{walk.ModControl, walk.KeyO})
+ importAction.SetDefault(true)
importAction.Triggered().Attach(tp.onImport)
addAction := walk.NewAction()
addAction.SetText("Add empty tunnel")