mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Add a global Redraw method for TextWidget
Partially addresses #429, by centralizing widget drawing
This commit is contained in:
@@ -12,7 +12,6 @@ type Widget struct {
|
||||
|
||||
Battery *Battery
|
||||
|
||||
app *tview.Application
|
||||
settings *Settings
|
||||
}
|
||||
|
||||
@@ -22,7 +21,6 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
|
||||
Battery: NewBattery(),
|
||||
|
||||
app: app,
|
||||
settings: settings,
|
||||
}
|
||||
|
||||
@@ -39,7 +37,5 @@ func (widget *Widget) Refresh() {
|
||||
content = content + "\n"
|
||||
content = content + widget.Battery.String()
|
||||
|
||||
widget.app.QueueUpdateDraw(func() {
|
||||
widget.View.SetText(content)
|
||||
})
|
||||
widget.Redraw(widget.CommonSettings.Title, content, true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user