summaryrefslogtreecommitdiff
path: root/utils.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2018-10-24 13:58:30 +0200
committerNikolaus Gotsche <n@softwarefools.com>2018-10-24 13:58:30 +0200
commit261d250f50b17117e99ab8b4b6ac7dfd35371386 (patch)
tree5ef9261936af3d87ea0356997863ccf5d1253d84 /utils.go
parent3bbc28806f43c323b21d9053a9e25c89614d5f60 (diff)
Finished Interface Framing
Diffstat (limited to 'utils.go')
-rw-r--r--utils.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/utils.go b/utils.go
index bed36aa..ae52f44 100644
--- a/utils.go
+++ b/utils.go
@@ -15,9 +15,10 @@ import (
)
const (
- framewidth int = 40
+ framewidth int = 50
li string = "\u2500"
mli string = "\u2500\u2530\u2500\u2500" //Masterline -T-
+ ssli string = " \u2520\u2500\u2500" //Slave Line L__
sli string = " \u2520\u2500 " //Slave Line L_
nli string = " \u2503 " //noone Line |
fli string = " \u2516\u2500\u2500" //Footer Line L
@@ -42,6 +43,18 @@ func negR() (out string){
return
}
+func sub(text string) (out string) {
+ out = ssli +text
+ n := utf8.RuneCountInString(out)
+ r := framewidth - n
+ if r < 1 {
+ out = out + li
+ }else{
+ out = out + strings.Repeat(li,r)
+ }
+ return
+}
+
func frame(text string, head bool) (out string) {
if head {
out = mli + text