1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Handle all the widgets that use GetRect

This commit is contained in:
Sean Smith
2019-08-24 23:19:46 -04:00
parent 264f49fd2c
commit 51e4325f0b
7 changed files with 42 additions and 19 deletions

View File

@@ -62,6 +62,10 @@ func (widget *Widget) HelpText() string {
/* -------------------- Unexported Functions -------------------- */
func (widget *Widget) display() {
widget.RedrawFunc(widget.content)
}
func (widget *Widget) content() (string, string, bool) {
widget.client.screenName = widget.CurrentSource()
tweets := widget.client.Tweets()
@@ -69,8 +73,7 @@ func (widget *Widget) display() {
if len(tweets) == 0 {
str := fmt.Sprintf("\n\n\n%s", utils.CenterText("[lightblue]No Tweets[white]", 50))
widget.Redraw(title, str, true)
return
return title, str, true
}
_, _, width, _ := widget.View.GetRect()
@@ -79,7 +82,7 @@ func (widget *Widget) display() {
str += widget.format(tweet)
}
widget.Redraw(title, str, true)
return title, str, true
}
// If the tweet's Username is the same as the account we're watching, no