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:
@@ -30,7 +30,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" 📄 Text File ", "textfile", true),
|
||||
TextWidget: wtf.NewTextWidget(" Text File ", "textfile", true),
|
||||
|
||||
app: app,
|
||||
filePath: Config.UString("wtf.mods.textfile.filePath"),
|
||||
@@ -53,7 +53,7 @@ func (widget *Widget) Refresh() {
|
||||
}
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(fmt.Sprintf(" 📄 %s ", widget.filePath))
|
||||
widget.View.SetTitle(fmt.Sprintf("%s %s", widget.Name, widget.filePath))
|
||||
|
||||
filePath, _ := wtf.ExpandHomeDir(widget.filePath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user