From 890ef2c575380ba266982d7283fd8d8ed9384eb6 Mon Sep 17 00:00:00 2001 From: Mark D Horn Date: Tue, 14 Jan 2020 18:02:12 -0800 Subject: [PATCH] style: propagate style to view contents Setting style on a text view now also applies to contents within the window. --- textview.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/textview.go b/textview.go index 6d00686..83f8430 100644 --- a/textview.go +++ b/textview.go @@ -98,7 +98,10 @@ func (l *TextView) drawText() { maxWidth := l.width - 1 maxHeight := l.outputHeight() - fg, bg := l.TextColor(), l.BackColor() + bg, fg := RealColor(l.bg, l.Style(), ColorEditBack), RealColor(l.fg, l.Style(), ColorEditText) + if l.Active() { + bg, fg = RealColor(l.bg, l.Style(), ColorEditActiveBack), RealColor(l.fg, l.Style(), ColorEditActiveText) + } SetTextColor(fg) SetBackColor(bg)