diff --git a/bamboohr/widget.go b/bamboohr/widget.go index eb5da302..2133fc50 100644 --- a/bamboohr/widget.go +++ b/bamboohr/widget.go @@ -33,7 +33,7 @@ func NewWidget() *Widget { func (widget *Widget) Refresh() { items := Fetch() - widget.View.SetTitle(fmt.Sprintf(" 🐨 Away (%d) ", len(items))) + widget.View.SetTitle(fmt.Sprintf(" 👽 Away (%d) ", len(items))) widget.RefreshedAt = time.Now() fmt.Fprintf(widget.View, "%s", widget.contentFrom(items)) @@ -52,7 +52,15 @@ func (widget *Widget) addView() { widget.View = view } +func centerText(str string, width int) string { + return fmt.Sprintf("%[1]*s", -width, fmt.Sprintf("%[1]*s", (width+len(str))/2, str)) +} + func (widget *Widget) contentFrom(items []Item) string { + if len(items) == 0 { + return fmt.Sprintf("\n\n\n\n\n\n\n%s", centerText("[grey]no one[white]", 52)) + } + str := "" for _, item := range items { diff --git a/gcal/widget.go b/gcal/widget.go index 8158eefd..0bf5b7c5 100644 --- a/gcal/widget.go +++ b/gcal/widget.go @@ -35,7 +35,7 @@ func NewWidget() *Widget { func (widget *Widget) Refresh() { events := Fetch() - widget.View.SetTitle(" 🐸 Calendar ") + widget.View.SetTitle(" 🍿 Calendar ") widget.RefreshedAt = time.Now() fmt.Fprintf(widget.View, "%s", widget.contentFrom(events)) diff --git a/status/widget.go b/status/widget.go index 562d4577..057ea46c 100644 --- a/status/widget.go +++ b/status/widget.go @@ -32,7 +32,7 @@ func NewWidget() *Widget { /* -------------------- Exported Functions -------------------- */ func (widget *Widget) Refresh() { - widget.View.SetTitle(" 🦊 Status ") + widget.View.SetTitle(" 🎁 Status ") widget.RefreshedAt = time.Now() widget.View.Clear() diff --git a/wtf.go b/wtf.go index bdf05bad..bcf4564d 100644 --- a/wtf.go +++ b/wtf.go @@ -43,7 +43,7 @@ func main() { weather.Refresh() grid := tview.NewGrid() - grid.SetRows(9, 9, 32, 4) // How _high_ the row is, in terminal rows + grid.SetRows(9, 9, 33, 3) // How _high_ the row is, in terminal rows grid.SetColumns(40, 40) // How _wide_ the column is, in terminal columns grid.SetBorder(false)