refactor: add (*application).focusMessageInput func
This commit is contained in:
parent
dcc607cf02
commit
ed6f5fc359
1 changed files with 10 additions and 3 deletions
|
|
@ -119,9 +119,7 @@ func (a *application) onPagesInputCapture(event *tcell.EventKey) *tcell.EventKey
|
|||
a.SetFocus(a.messagesList)
|
||||
return nil
|
||||
case a.cfg.Keys.FocusMessageInput:
|
||||
if !a.messageInput.GetDisabled() {
|
||||
a.SetFocus(a.messageInput)
|
||||
}
|
||||
a.focusMessageInput()
|
||||
return nil
|
||||
case a.cfg.Keys.FocusPrevious:
|
||||
a.focusPrevious()
|
||||
|
|
@ -169,6 +167,15 @@ func (a *application) focusGuildsTree() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func (a *application) focusMessageInput() bool {
|
||||
if !a.messageInput.GetDisabled() {
|
||||
a.SetFocus(a.messageInput)
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (a *application) focusPrevious() {
|
||||
switch a.GetFocus() {
|
||||
case a.guildsTree:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue