Focus username field in login view automatically
This commit is contained in:
parent
d0f55f4a6f
commit
e9cf38a866
2
ui/ui.go
2
ui/ui.go
@ -66,7 +66,7 @@ func (ui *GomuksUI) Init() {
|
|||||||
ViewLogin: ui.NewLoginView(),
|
ViewLogin: ui.NewLoginView(),
|
||||||
ViewMain: ui.NewMainView(),
|
ViewMain: ui.NewMainView(),
|
||||||
}
|
}
|
||||||
ui.app.Root = ui.views[ViewLogin]
|
ui.SetView(ViewLogin)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ui *GomuksUI) Start() error {
|
func (ui *GomuksUI) Start() error {
|
||||||
|
@ -87,9 +87,11 @@ func (ui *GomuksUI) NewLoginView() mauview.Component {
|
|||||||
AddComponent(view.usernameLabel, 1, 1, 1, 1).
|
AddComponent(view.usernameLabel, 1, 1, 1, 1).
|
||||||
AddComponent(view.passwordLabel, 1, 3, 1, 1).
|
AddComponent(view.passwordLabel, 1, 3, 1, 1).
|
||||||
AddComponent(view.homeserverLabel, 1, 5, 1, 1)
|
AddComponent(view.homeserverLabel, 1, 5, 1, 1)
|
||||||
|
view.FocusNextItem()
|
||||||
ui.loginView = view
|
ui.loginView = view
|
||||||
|
|
||||||
view.container = mauview.Center(mauview.NewBox(view).SetTitle("Log in to Matrix"), 45, 13)
|
view.container = mauview.Center(mauview.NewBox(view).SetTitle("Log in to Matrix"), 45, 13)
|
||||||
|
view.container.SetAlwaysFocusChild(true)
|
||||||
return view.container
|
return view.container
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user