mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Renormalize the redraw function
Have all instances take a function Update the remaining modules to take this into account Numerous smaller refactors to make some widgets work more or less the same
This commit is contained in:
@@ -30,7 +30,7 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.prettyWeather()
|
||||
|
||||
widget.RedrawFunc(func() (string, string, bool) { return widget.CommonSettings().Title, widget.result, false })
|
||||
widget.Redraw(func() (string, string, bool) { return widget.CommonSettings().Title, widget.result, false })
|
||||
}
|
||||
|
||||
//this method reads the config and calls wttr.in for pretty weather
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func (widget *Widget) display() {
|
||||
widget.RedrawFunc(widget.content)
|
||||
widget.Redraw(widget.content)
|
||||
}
|
||||
|
||||
func (widget *Widget) content() (string, string, bool) {
|
||||
|
||||
Reference in New Issue
Block a user