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:
@@ -29,12 +29,14 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
return &widget
|
||||
}
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.Battery.Refresh()
|
||||
|
||||
func (widget *Widget) content() (string, string, bool) {
|
||||
content := fmt.Sprintf(" %10s: %s\n", "Source", powerSource())
|
||||
content += "\n"
|
||||
content += widget.Battery.String()
|
||||
|
||||
widget.Redraw(widget.CommonSettings().Title, content, true)
|
||||
return widget.CommonSettings().Title, content, true
|
||||
}
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.Battery.Refresh()
|
||||
widget.RedrawFunc(widget.content)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user