aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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)
}