summaryrefslogtreecommitdiffstats
path: root/widgets/help.go
diff options
context:
space:
mode:
authorSean E. Russell <ser@ser1.net>2020-04-16 10:18:00 -0500
committerSean E. Russell <ser@ser1.net>2020-04-16 10:18:00 -0500
commitd22c36e7195b80c199c25a7a0ed2525555e1de00 (patch)
tree240991a7c203f3d3eaa8444f412dc75bff56a931 /widgets/help.go
parent193b40f30ecb949caa75285a3d86cef0d44fb177 (diff)
Fix #47, help & statusbar don't obey theme. Also fix help text layout.
Diffstat (limited to 'widgets/help.go')
-rw-r--r--widgets/help.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/widgets/help.go b/widgets/help.go
index 9f78dd0..8aab35d 100644
--- a/widgets/help.go
+++ b/widgets/help.go
@@ -54,6 +54,11 @@ func NewHelpMenu() *HelpMenu {
func (self *HelpMenu) Resize(termWidth, termHeight int) {
textWidth := 53
+ for _, line := range strings.Split(KEYBINDS, "\n") {
+ if textWidth < len(line) {
+ textWidth = len(line) + 2
+ }
+ }
textHeight := strings.Count(KEYBINDS, "\n") + 1
x := (termWidth - textWidth) / 2
y := (termHeight - textHeight) / 2
@@ -67,7 +72,7 @@ func (self *HelpMenu) Draw(buf *ui.Buffer) {
for y, line := range strings.Split(KEYBINDS, "\n") {
for x, rune := range line {
buf.SetCell(
- ui.NewCell(rune, ui.NewStyle(7)),
+ ui.NewCell(rune, ui.Theme.Default),
image.Pt(self.Inner.Min.X+x, self.Inner.Min.Y+y-1),
)
}