diff options
Diffstat (limited to 'ui/editdialog.go')
-rw-r--r-- | ui/editdialog.go | 8 |
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 } |