浏览代码

Added TitleColor to panel.

Steve Thielemann 3 年之前
父节点
当前提交
9caa364d8e
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      door/panel.go

+ 2 - 1
door/panel.go

@@ -23,6 +23,7 @@ type Panel struct {
 	BorderColor string
 	Lines       []Line
 	Title       string
+        TitleColor  string
 	TitleOffset int
 }
 
@@ -45,7 +46,7 @@ func (p *Panel) Output() string {
 				log.Panicf("Panel (not wide enough) Width %d : Title size %d + offset %d = %d\n",
 					p.Width, len(p.Title), p.TitleOffset, p.TitleOffset+len(p.Title))
 			}
-			output += strings.Repeat(box_style.top, p.TitleOffset) + p.Title
+			output += strings.Repeat(box_style.top, p.TitleOffset) + p.TitleColor + p.Title + p.BorderColor
 		}
 		output += strings.Repeat(box_style.top, p.Width-(p.TitleOffset+len(p.Title))) + box_style.top_right
 		row++