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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user