From 9adeb2762644fd91c6321dcc7d1a33e56c50a616 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 5 May 2019 15:13:29 +0200 Subject: ui: fix weird scrolling behavior in editor --- ui/editdialog.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ui') 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 . We should fix this in walk instead of here. + + dlg.Starting().Attach(func() { + dlg.syntaxEdit.SetFocus() + }) + } + if dlg.Run() == walk.DlgCmdOK { return &dlg.config } -- cgit v1.2.3-59-g8ed1b