From fa04a1e036a418258451466d99de34a9546a9965 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 30 Mar 2019 14:12:04 -0400 Subject: Add basic message viewer mockup --- lib/ui/text.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/ui/text.go') diff --git a/lib/ui/text.go b/lib/ui/text.go index aa97954..761673c 100644 --- a/lib/ui/text.go +++ b/lib/ui/text.go @@ -16,6 +16,7 @@ type Text struct { strategy uint fg tcell.Color bg tcell.Color + bold bool reverse bool onInvalidate func(d Drawable) } @@ -40,6 +41,12 @@ func (t *Text) Strategy(strategy uint) *Text { return t } +func (t *Text) Bold(bold bool) *Text { + t.bold = bold + t.Invalidate() + return t +} + func (t *Text) Color(fg tcell.Color, bg tcell.Color) *Text { t.fg = fg t.bg = bg @@ -63,6 +70,9 @@ func (t *Text) Draw(ctx *Context) { x = ctx.Width() - size } style := tcell.StyleDefault.Background(t.bg).Foreground(t.fg) + if t.bold { + style = style.Bold(true) + } if t.reverse { style = style.Reverse(true) } -- cgit 1.4.1-2-gfad0