Updated list behaviour, see #11

pull/24/head
マリウス 2 years ago
parent 19adc94508
commit 803fa844eb
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F

@ -118,17 +118,19 @@ USAGE
Keyboard shortcuts:
- C-R: Refresh
- C-H: Focus groups list
- C-L: Focus articles list
- C-Q: Quit
- K: Move up in list
- J: Move down in list
- H: Move left in list
- L: Move right in list
- C-r: Refresh
- C-h: Focus groups list
- C-l: Focus articles list
- C-q: Quit
- k: Move up in list
- j: Move down in list
- h: Move left in list
- l: Move right in list
- g: Move to the beginning of the list
- G: Move to the end of the list
- CR: Select item in list
- N: Publish new article
- R: Reply to selected article
- n: Publish new article
- r: Reply to selected article

@ -59,7 +59,7 @@ func(t *TUI) NewMainscreen() (*Mainscreen) {
mainscreen.T = t
mainscreen.Groups = tview.NewList().
SetWrapAround(true).
SetWrapAround(false).
ShowSecondaryText(false).
SetHighlightFullLine(true).
SetMainTextColor(tcell.ColorWhite).
@ -74,7 +74,7 @@ func(t *TUI) NewMainscreen() (*Mainscreen) {
SetBorderColor(tcell.ColorTeal)
mainscreen.Articles = tview.NewList().
SetWrapAround(true).
SetWrapAround(false).
ShowSecondaryText(true).
SetHighlightFullLine(true).
SetMainTextColor(tcell.ColorTeal).
@ -276,17 +276,23 @@ func (mainscreen *Mainscreen) HandleInput(event *tcell.EventKey) (*tcell.EventKe
mainscreen.replyToArticle(mainscreen.ArticlesList[mainscreen.CurrentArticleSelected])
return nil
case 'j':
mainscreen.T.App.QueueEvent(tcell.NewEventKey(tcell.KeyDown, 0, tcell.ModNone))
return nil
mainscreen.T.App.QueueEvent(tcell.NewEventKey(tcell.KeyDown, 0, tcell.ModNone))
return nil
case 'k':
mainscreen.T.App.QueueEvent(tcell.NewEventKey(tcell.KeyUp, 0, tcell.ModNone))
return nil
mainscreen.T.App.QueueEvent(tcell.NewEventKey(tcell.KeyUp, 0, tcell.ModNone))
return nil
case 'h':
mainscreen.T.App.QueueEvent(tcell.NewEventKey(tcell.KeyLeft, 0, tcell.ModNone))
return nil
mainscreen.T.App.QueueEvent(tcell.NewEventKey(tcell.KeyLeft, 0, tcell.ModNone))
return nil
case 'l':
mainscreen.T.App.QueueEvent(tcell.NewEventKey(tcell.KeyRight, 0, tcell.ModNone))
return nil
mainscreen.T.App.QueueEvent(tcell.NewEventKey(tcell.KeyRight, 0, tcell.ModNone))
return nil
case 'g':
if event.Rune() == 'G' {
mainscreen.T.App.QueueEvent(tcell.NewEventKey(tcell.KeyEnd, 0, tcell.ModNone))
} else {
mainscreen.T.App.QueueEvent(tcell.NewEventKey(tcell.KeyHome, 0, tcell.ModNone))
}
}
return event
}

Loading…
Cancel
Save