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:
committed by
Chris Cummer
parent
31e17da358
commit
8e3287ba5c
@@ -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, " • ")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user