1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Fix a bug in scrollable.RowColor

This commit is contained in:
Chris Cummer 2019-05-11 08:41:00 -07:00
parent 78fc097818
commit 2067a73072
2 changed files with 4 additions and 3 deletions

View File

@ -97,13 +97,14 @@ func (widget *Widget) Render() {
func (widget *Widget) contentFrom(stories []Story) string {
var str string
for idx, story := range stories {
u, _ := url.Parse(story.URL)
str = str + fmt.Sprintf(
`["%d"][""][%s] [yellow]%d. [%s]%s [blue](%s)[""]`,
`["%d"][""][%s]%2d. %s [lightblue](%s)[white][""]`,
idx,
widget.RowColor(idx),
idx+1,
widget.RowColor(idx),
story.Title,
strings.TrimPrefix(u.Host, "www."),
)

View File

@ -41,7 +41,7 @@ func (widget *ScrollableWidget) GetSelected() int {
func (widget *ScrollableWidget) RowColor(idx int) string {
if widget.View.HasFocus() && (idx == widget.selected) {
widget.CommonSettings.DefaultFocussedRowColor()
return widget.CommonSettings.DefaultFocussedRowColor()
}
return widget.CommonSettings.RowColor(idx)