aboutsummaryrefslogtreecommitdiff
path: root/lib/ui
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-30 14:12:04 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-30 14:12:04 -0400
commitfa04a1e036a418258451466d99de34a9546a9965 (patch)
treeec409d99e9a306488c6ffb9b71683e171a2ec007 /lib/ui
parent2958579ee75359dacfabb6d1b36664468011113c (diff)
Add basic message viewer mockup
Diffstat (limited to 'lib/ui')
-rw-r--r--lib/ui/text.go10
1 files changed, 10 insertions, 0 deletions
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)
}