aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-05 15:13:29 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-05 15:13:29 +0200
commit6d6b49e4730d95b6c06e91c38fd7d9253ee8ae85 (patch)
tree62b279cddce713906dbe48a23c7fbe7e871b0a69
parentui: check for duplicate names always (diff)
downloadwireguard-windows-6d6b49e4730d95b6c06e91c38fd7d9253ee8ae85.tar.xz
wireguard-windows-6d6b49e4730d95b6c06e91c38fd7d9253ee8ae85.zip
ui: fix weird scrolling behavior in editor
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--ui/editdialog.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/editdialog.go b/ui/editdialog.go
index 724d40f3..ac441f32 100644
--- a/ui/editdialog.go
+++ b/ui/editdialog.go
@@ -107,6 +107,14 @@ func runTunnelEditDialog(owner walk.Form, tunnel *service.Tunnel) *conf.Config {
dlg.syntaxEdit.BlockUntunneledTrafficStateChanged().Attach(dlg.onBlockUntunneledTrafficStateChanged)
dlg.syntaxEdit.SetText(dlg.config.ToWgQuick())
+ if tunnel != nil {
+ dlg.nameEdit.SetFocus() //TODO: This works around a walk issue with scrolling in weird ways <https://github.com/lxn/walk/issues/505>. We should fix this in walk instead of here.
+
+ dlg.Starting().Attach(func() {
+ dlg.syntaxEdit.SetFocus()
+ })
+ }
+
if dlg.Run() == walk.DlgCmdOK {
return &dlg.config
}