diff options
author | T <t@tjp.lol> | 2025-08-12 15:07:09 -0600 |
---|---|---|
committer | T <t@tjp.lol> | 2025-08-13 11:55:52 -0600 |
commit | aceb81114f4df7d6bd9ff2af19ab7d51d202b6a3 (patch) | |
tree | 1756cee0cebb8ec44a9ee2fc9011b459592f3665 /internal/tui/shared.go | |
parent | d7915ed8ca5272c0feaca319c0237f8408d8031d (diff) |
fix bottom bar style rendering
Diffstat (limited to 'internal/tui/shared.go')
-rw-r--r-- | internal/tui/shared.go | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/internal/tui/shared.go b/internal/tui/shared.go index e0ee9a0..ebaec6f 100644 --- a/internal/tui/shared.go +++ b/internal/tui/shared.go @@ -154,28 +154,33 @@ func RenderTopBar(m AppModel) string { // RenderBottomBar renders the bottom bar with key bindings func RenderBottomBar(m AppModel, bindings []KeyBinding, err error) string { var content string + + // Style for keys (inherits background from bottomBarStyle) + keyStyle := bottomBarStyle.Bold(true) + // Style for descriptions (inherits background from bottomBarStyle) + descStyle := bottomBarStyle + // Style for separators (inherits background from bottomBarStyle) + sepStyle := bottomBarStyle + for i, binding := range bindings { if binding.Hide { continue } if i > 0 { - content += " " + content += sepStyle.Render(" ") } - keyStyle := lipgloss.NewStyle().Bold(true) - formattedKey := keyStyle.Render(fmt.Sprintf("[%s]", binding.Key)) - content += fmt.Sprintf("%s %s", formattedKey, binding.Description(m)) + content += keyStyle.Render(fmt.Sprintf("[%s]", binding.Key)) + content += descStyle.Render(fmt.Sprintf(" %s", binding.Description(m))) } - content = bottomBarStyle.Align(lipgloss.Left).Render(content) if err != nil { - content = lipgloss.JoinHorizontal( - lipgloss.Bottom, - content, - bottomBarStyle.Bold(true).Foreground(lipgloss.Color("196")).Align(lipgloss.Right).Render(err.Error()), - ) + // Style for errors (inherits background, adds red foreground) + errorStyle := bottomBarStyle.Bold(true).Foreground(lipgloss.Color("196")) + content += sepStyle.Render(" ") + content += errorStyle.Render(err.Error()) } - return bottomBarStyle.Width(m.width).Render(content) + return bottomBarStyle.Width(m.width).Align(lipgloss.Left).Render(content) } // GetAppData fetches all data needed for the TUI |