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 hasCurStyle bool = false
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 {
if !hasCurStyle {
@ -31,18 +33,18 @@ func SetCurrentStyles(styles *style.Styles) {
func Title(title string, subtitle string) {
Cstyle("").Echof("\n ")
Cstyle("appSep").Echof(" :: ")
Cstyle("appSep").Echof(SYMB_TITLE_SEP)
Cstyle("appTitle").Echof(title)
if subtitle != "" {
Cstyle("appSubTitle").Echof(" %s", subtitle)
}
Cstyle("appSep").Echof(" :: ")
Cstyle("appSep").Echof(SYMB_TITLE_SEP)
Ln()
}
func Action(action string, param string) {
Ln()
Cstyle("actionSep").Echo(" * ")
Cstyle("actionSep").Echo(SYMB_ACTION)
Cstyle("action").Echof("%s ", action)
Cstyle("param").Echo(param)
Ln()