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

33 lines
570 B
Go

package todoist
import (
"fmt"
"github.com/rivo/tview"
"github.com/wtfutil/wtf/wtf"
)
func (widget *Widget) display() {
proj := widget.CurrentProject()
if proj == nil {
return
}
title := fmt.Sprintf("[green]%s[white]", proj.Project.Name)
str := ""
for index, item := range proj.tasks {
row := fmt.Sprintf(
`[%s]| | %s[%s]`,
widget.RowColor(index),
tview.Escape(item.Content),
widget.RowColor(index),
)
str += wtf.HighlightableHelper(widget.View, row, index, len(item.Content))
}
widget.ScrollableWidget.Redraw(title, str, false)
}