fix(ui): login screen loses focus on focus keybindings (#131)

This commit is contained in:
ayntgl 2022-03-02 23:44:29 +04:00 • committed by GitHub
parent 65abbc82cf
commit 65356499c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,19 +75,21 @@ func (app *App) onInputCapture(e *tcell.EventKey) *tcell.EventKey {
return e
}
switch e.Name() {
case app.Config.Keybindings.ToggleGuildsList:
app.SetFocus(app.GuildsList)
return nil
case app.Config.Keybindings.ToggleChannelsTreeView:
app.SetFocus(app.ChannelsTreeView)
return nil
case app.Config.Keybindings.ToggleMessagesTextView:
app.SetFocus(app.MessagesTextView)
return nil
case app.Config.Keybindings.ToggleMessageInputField:
app.SetFocus(app.MessageInputField)
return nil
if app.MainFlex.GetItemCount() != 0 {
switch e.Name() {
case app.Config.Keybindings.ToggleGuildsList:
app.SetFocus(app.GuildsList)
return nil
case app.Config.Keybindings.ToggleChannelsTreeView:
app.SetFocus(app.ChannelsTreeView)
return nil
case app.Config.Keybindings.ToggleMessagesTextView:
app.SetFocus(app.MessagesTextView)
return nil
case app.Config.Keybindings.ToggleMessageInputField:
app.SetFocus(app.MessageInputField)
return nil
}
}
return e