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

Merge pull request #625 from wtfutil/20190910-no-title

Add the ability to display no title
This commit is contained in:
Chris Cummer 2019-09-10 16:22:25 -07:00 committed by GitHub
commit 9b23da07ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,12 +61,16 @@ func (base *Base) ConfigText() string {
}
func (base *Base) ContextualTitle(defaultStr string) string {
if base.FocusChar() == "" {
if defaultStr == "" && base.FocusChar() == "" {
return ""
} else if defaultStr != "" && base.FocusChar() == "" {
return fmt.Sprintf(" %s ", defaultStr)
}
} else if defaultStr == "" && base.FocusChar() != "" {
return fmt.Sprintf(" [darkgray::u]%s[::-][green] ", base.FocusChar())
} else {
return fmt.Sprintf(" %s [darkgray::u]%s[::-][green] ", defaultStr, base.FocusChar())
}
}
func (base *Base) Disable() {
base.enabled = false