mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Clean up drawing functionality
Fix up a bunch of missed places that can use the standardized `Redraw` method
This commit is contained in:
@@ -36,15 +36,13 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
func (widget *Widget) Refresh() {
|
||||
positions, err := Fetch(widget.device_token)
|
||||
if err != nil {
|
||||
widget.Redraw(widget.CommonSettings.Title, err.Error(), true)
|
||||
return
|
||||
}
|
||||
|
||||
content := widget.contentFrom(positions)
|
||||
|
||||
widget.app.QueueUpdateDraw(func() {
|
||||
widget.View.SetTitle(widget.CommonSettings.Title)
|
||||
widget.View.SetText(content)
|
||||
})
|
||||
widget.Redraw(widget.CommonSettings.Title, content, false)
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
Reference in New Issue
Block a user