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

Convert the bulk of modules over to RedrawFunc

This commit is contained in:
Sean Smith
2019-08-26 23:07:02 -04:00
parent 51e4325f0b
commit 3a716bcf9a
25 changed files with 214 additions and 224 deletions

View File

@@ -28,12 +28,12 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
/* -------------------- Exported Functions -------------------- */
func (widget *Widget) Refresh() {
widget.Redraw(widget.CommonSettings().Title, widget.animation(), false)
widget.RedrawFunc(widget.animation)
}
/* -------------------- Unexported Functions -------------------- */
func (widget *Widget) animation() string {
func (widget *Widget) animation() (string, string, bool) {
icons := []string{"|", "/", "-", "\\", "|"}
next := icons[widget.CurrentIcon]
@@ -42,5 +42,5 @@ func (widget *Widget) animation() string {
widget.CurrentIcon = 0
}
return next
return widget.CommonSettings().Title, next, false
}