Call view.FocusNextItem() after loginButton press to skip quitButton and prevent unexpected termination.

This commit is contained in:
Jason Volk 2019-06-27 05:12:48 -06:00
parent d64ec156a4
commit cda9f9ba4c

View file

@ -75,7 +75,7 @@ func (ui *GomuksUI) NewLoginView() mauview.Component {
view.password.SetMaskCharacter('*')
view.quitButton.SetOnClick(func() { ui.gmx.Stop(true) }).SetBackgroundColor(tcell.ColorDarkCyan)
view.loginButton.SetOnClick(view.Login).SetBackgroundColor(tcell.ColorDarkCyan)
view.loginButton.SetOnClick(func() { view.Login(); view.FocusNextItem(); }).SetBackgroundColor(tcell.ColorDarkCyan)
view.SetColumns([]int{1, 10, 1, 9, 1, 9, 1, 10, 1})
view.SetRows([]int{1, 1, 1, 1, 1, 1, 1, 1, 1, 1})