Skip to content

Commit

Permalink
add frame and title color for view
Browse files Browse the repository at this point in the history
  • Loading branch information
dankox committed Oct 25, 2020
1 parent d0eae9e commit a7e8d20
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 10 additions & 2 deletions gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,17 @@ func (g *Gui) flush() error {
bgColor = g.SelBgColor
frameColor = g.SelFrameColor
} else {
fgColor = g.FgColor
bgColor = g.BgColor
frameColor = g.FrameColor
if v.TitleColor != 0 {
fgColor = v.TitleColor
} else {
fgColor = g.FgColor
}
if v.FrameColor != 0 {
frameColor = v.FrameColor
} else {
frameColor = g.FrameColor
}
}

if err := g.drawFrameEdges(v, frameColor, bgColor); err != nil {
Expand Down
6 changes: 6 additions & 0 deletions view.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ type View struct {
// If Frame is true, a border will be drawn around the view.
Frame bool

// FrameColor allow to configure the color of the Frame when it is not highlighted.
FrameColor Attribute

// If Wrap is true, the content that is written to this View is
// automatically wrapped when it is longer than its width. If true the
// view's x-origin will be ignored.
Expand All @@ -99,6 +102,9 @@ type View struct {
// If Frame is true, Title allows to configure a title for the view.
Title string

// TitleColor allow to configure the color of title and subtitle for the view.
TitleColor Attribute

// If Frame is true, Subtitle allows to configure a subtitle for the view.
Subtitle string

Expand Down

0 comments on commit a7e8d20

Please sign in to comment.