diff options
Diffstat (limited to 'internal/tui')
-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 |