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:
@@ -14,7 +14,6 @@ import (
|
||||
type Widget struct {
|
||||
wtf.TextWidget
|
||||
|
||||
app *tview.Application
|
||||
result string
|
||||
settings *Settings
|
||||
}
|
||||
@@ -34,7 +33,6 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(app, settings.common, false),
|
||||
|
||||
app: app,
|
||||
settings: settings,
|
||||
}
|
||||
|
||||
@@ -46,10 +44,7 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.ipinfo()
|
||||
|
||||
widget.app.QueueUpdateDraw(func() {
|
||||
widget.View.Clear()
|
||||
widget.View.SetText(widget.result)
|
||||
})
|
||||
widget.TextWidget.Redraw(widget.CommonSettings.Title, widget.result, false)
|
||||
}
|
||||
|
||||
//this method reads the config and calls ipinfo for ip information
|
||||
|
||||
Reference in New Issue
Block a user