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

Cleaner code around widget creation in wtf.go

This commit is contained in:
Chris Cummer
2018-04-13 12:00:29 -07:00
committed by Chris Cummer
parent 31e17da358
commit 8e3287ba5c
3 changed files with 22 additions and 22 deletions

View File

@@ -39,10 +39,12 @@ func (widget *Widget) Refresh() {
widget.RefreshedAt = time.Now()
_, _, w, _ := widget.View.GetInnerRect()
widget.View.Clear()
fmt.Fprintf(
widget.View,
"%107s\n%123s",
fmt.Sprintf("%%%ds\n%%%ds", w-2, w-1),
widget.animation(),
widget.timezones(),
)
@@ -86,5 +88,5 @@ func (widget *Widget) timezones() string {
formattedTimes = append(formattedTimes, time.Format(wtf.TimeFormat))
}
return strings.Join(formattedTimes, " [yellow]•[white] ")
return strings.Join(formattedTimes, "  ")
}