echo - permit symb customization

This commit is contained in:
Mahdi Abu Yasmine 2023-11-18 00:20:41 +01:00
parent 4869aa5f30
commit 09118b9073

View File

@ -12,6 +12,8 @@ import (
var curStyles *style.Styles var curStyles *style.Styles
var hasCurStyle bool = false var hasCurStyle bool = false
var msgUninit = "Missing current *style.Styles, you should call echo.SetCurrentStyles(styles *style.Styles) first" var msgUninit = "Missing current *style.Styles, you should call echo.SetCurrentStyles(styles *style.Styles) first"
var SYMB_TITLE_SEP = " :: "
var SYMB_ACTION = " * "
func Cstyle(name string) *style.Style { func Cstyle(name string) *style.Style {
if !hasCurStyle { if !hasCurStyle {
@ -31,18 +33,18 @@ func SetCurrentStyles(styles *style.Styles) {
func Title(title string, subtitle string) { func Title(title string, subtitle string) {
Cstyle("").Echof("\n ") Cstyle("").Echof("\n ")
Cstyle("appSep").Echof(" :: ") Cstyle("appSep").Echof(SYMB_TITLE_SEP)
Cstyle("appTitle").Echof(title) Cstyle("appTitle").Echof(title)
if subtitle != "" { if subtitle != "" {
Cstyle("appSubTitle").Echof(" %s", subtitle) Cstyle("appSubTitle").Echof(" %s", subtitle)
} }
Cstyle("appSep").Echof(" :: ") Cstyle("appSep").Echof(SYMB_TITLE_SEP)
Ln() Ln()
} }
func Action(action string, param string) { func Action(action string, param string) {
Ln() Ln()
Cstyle("actionSep").Echo(" * ") Cstyle("actionSep").Echo(SYMB_ACTION)
Cstyle("action").Echof("%s ", action) Cstyle("action").Echof("%s ", action)
Cstyle("param").Echo(param) Cstyle("param").Echo(param)
Ln() Ln()