diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-04-20 09:38:56 -0500 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-04-20 18:11:23 +0200 |
commit | 80d5d8b35b450f7183fd46beedd7316f307c2b8d (patch) | |
tree | d063526395629aceddc645ee11e80ad677099773 /ui/buffers.go | |
parent | Update mailing list (diff) |
Add a config option for unread buffer text color
This patch adds the ability to set a config option for changing the
foreground text color of unread buffers
(This was refactored slightly by delthas.)
Diffstat (limited to 'ui/buffers.go')
-rw-r--r-- | ui/buffers.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/buffers.go b/ui/buffers.go index fa77414..553de9e 100644 --- a/ui/buffers.go +++ b/ui/buffers.go @@ -195,6 +195,8 @@ type buffer struct { } type BufferList struct { + colors ConfigColors + list []buffer overlay *buffer current int @@ -210,8 +212,9 @@ type BufferList struct { // NewBufferList returns a new BufferList. // Call Resize() once before using it. -func NewBufferList(mergeLine func(*Line, Line)) BufferList { +func NewBufferList(colors ConfigColors, mergeLine func(*Line, Line)) BufferList { return BufferList{ + colors: colors, list: []buffer{}, clicked: -1, doMergeLine: mergeLine, @@ -550,7 +553,7 @@ func (bs *BufferList) DrawVerticalBufferList(screen tcell.Screen, x0, y0, width, y := y0 + i st := tcell.StyleDefault if b.unread { - st = st.Bold(true) + st = st.Bold(true).Foreground(bs.colors.Unread) } if bi == bs.current || bi == bs.clicked { st = st.Reverse(true) @@ -644,7 +647,7 @@ func (bs *BufferList) DrawHorizontalBufferList(screen tcell.Screen, x0, y0, widt } st := tcell.StyleDefault if b.unread { - st = st.Bold(true) + st = st.Bold(true).Foreground(bs.colors.Unread) } else if i == bs.current { st = st.Underline(true) } |