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

WTF-400 Fix title display in CmdRunner

This commit is contained in:
Chris Cummer 2019-04-19 09:35:05 -07:00
parent 03e186a0cc
commit a8e3602817
2 changed files with 7 additions and 3 deletions

View File

@ -84,7 +84,7 @@ func NewCommonSettingsFromYAML(name, configKey string, ymlConfig *config.Config)
Enabled: ymlConfig.UBool(modulePath+".enabled", false), Enabled: ymlConfig.UBool(modulePath+".enabled", false),
FocusChar: ymlConfig.UInt(modulePath+".focusChar", -1), FocusChar: ymlConfig.UInt(modulePath+".focusChar", -1),
RefreshInterval: ymlConfig.UInt(modulePath+".refreshInterval", 300), RefreshInterval: ymlConfig.UInt(modulePath+".refreshInterval", 300),
Title: ymlConfig.UString(modulePath+".title", name), Title: ymlConfig.UString(modulePath+".title", ""),
} }
return &common return &common

View File

@ -35,8 +35,12 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
func (widget *Widget) Refresh() { func (widget *Widget) Refresh() {
widget.execute() widget.execute()
title := tview.TranslateANSI(wtf.Config.UString("wtf.mods.cmdrunner.title", widget.String())) title := widget.settings.common.Title
widget.View.SetTitle(title) if title == "" {
title = widget.String()
}
widget.View.SetTitle(tview.TranslateANSI(title))
widget.View.SetText(widget.result) widget.View.SetText(widget.result)
} }