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

Add the ability to display no title

This commit is contained in:
Chris Cummer 2019-09-10 16:18:00 -07:00
parent 04616ddff5
commit e059eeb625

View File

@ -61,11 +61,15 @@ 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())
}
return fmt.Sprintf(" %s [darkgray::u]%s[::-][green] ", defaultStr, base.FocusChar())
}
func (base *Base) Disable() {