Skip to content
Snippets Groups Projects
Unverified Commit 23be684a authored by sudoforge's avatar sudoforge Committed by GitHub
Browse files

feat(tui): improve readability of the help bar (#1412)

This change changes the help bar's background color to the "black" value
for the terminal, and increases spacing between the different commands
to improve readability.

Closes: git-bug/git-bug#1411
Change-Id: I380d1fee4ae51869876f00c76c0f952d47dd8912
parent f680ef74
No related branches found
No related tags found
No related merge requests found
...@@ -16,14 +16,19 @@ type helpBar []struct { ...@@ -16,14 +16,19 @@ type helpBar []struct {
func (hb helpBar) Render(maxX int) string { func (hb helpBar) Render(maxX int) string {
var builder strings.Builder var builder strings.Builder
for _, entry := range hb {
builder.WriteString(colors.White(colors.BlueBg(fmt.Sprintf("[%s] %s", entry.keys, entry.text)))) il := len(hb) - 1
builder.WriteByte(' ') for i, entry := range hb {
builder.WriteString(colors.White(colors.BlackBg(fmt.Sprintf("[%s] %s", entry.keys, entry.text))))
if i < il {
builder.WriteString(" ")
}
} }
l := text.Len(builder.String()) tl := text.Len(builder.String())
if l < maxX { if tl < maxX {
builder.WriteString(colors.White(colors.BlueBg(strings.Repeat(" ", maxX-l)))) builder.WriteString(colors.White(colors.BlackBg(strings.Repeat(" ", maxX-tl))))
} }
return builder.String() return builder.String()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment