1
0
mirror of https://github.com/taigrr/wtf synced 2026-03-25 13:52:19 -07:00

Add a global Redraw method for TextWidget

Partially addresses #429, by centralizing widget drawing
This commit is contained in:
Sean Smith
2019-05-07 20:49:46 -04:00
committed by Chris Cummer
parent aedcf9dd51
commit 018d2af3ae
48 changed files with 194 additions and 412 deletions

View File

@@ -29,13 +29,12 @@ func (widget *Widget) display() {
return
}
widget.View.SetTitle(widget.ContextualTitle(widget.settings.common.Title))
widget.View.SetText(widget.contentFrom(widget.calEvents))
widget.TextWidget.Redraw(widget.settings.common.Title, widget.contentFrom(widget.calEvents), false)
}
func (widget *Widget) contentFrom(calEvents []*CalEvent) string {
if (calEvents == nil) || (len(calEvents) == 0) {
return ""
return "No calendar events"
}
var str string