소스 검색

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++