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

Implement ASCII-only widget titles

Widget titles can now be specified in the config file via a 'title' key.
Example:

  wtf:
    mods:
      todo:
        title: Tada

which can include emoji. No need to force everyone to look at my emoji,
now they can define their own.
This commit is contained in:
Chris Cummer
2018-06-03 20:54:07 -07:00
parent c14902abb6
commit 218b6937b1
17 changed files with 22 additions and 24 deletions

View File

@@ -17,7 +17,7 @@ type Widget struct {
func NewWidget() *Widget {
widget := Widget{
TextWidget: wtf.NewTextWidget(" OpsGenie ", "opsgenie", false),
TextWidget: wtf.NewTextWidget(" OpsGenie ", "opsgenie", false),
}
return &widget
@@ -33,7 +33,7 @@ func (widget *Widget) Refresh() {
data, err := Fetch()
widget.UpdateRefreshedAt()
widget.View.SetTitle(" ⏰ On Call ")
widget.View.SetTitle(widget.Name)
if err != nil {
widget.View.SetWrap(true)