From cb72418324abfe6b133f0607b7269f5c4ec1f274 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sun, 9 Feb 2025 18:46:53 +0200 Subject: Choice popup colors are now runtime-friendly --- internal/client/ui/auth/auth.go | 15 ++++++++++++--- internal/client/ui/choicepopup/choicepopup.go | 4 +++- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'internal/client') diff --git a/internal/client/ui/auth/auth.go b/internal/client/ui/auth/auth.go index 2bfe5be..32fb232 100644 --- a/internal/client/ui/auth/auth.go +++ b/internal/client/ui/auth/auth.go @@ -65,9 +65,18 @@ ___] | |__] | \| | | \|`) return lipgloss.NewStyle().Background(colors.Background).Foreground(colors.White).PaddingLeft(1).Render("󰈉 ") } - popupStyle = func() lipgloss.Style { return lipgloss.NewStyle().Border(lipgloss.ThickBorder()) } - choiceSelectedStyle = func() lipgloss.Style { return lipgloss.NewStyle().Padding(0, 1).Margin(0, 1).Background(colors.Blue) } - choiceUnselectedStyle = func() lipgloss.Style { return lipgloss.NewStyle().Padding(0, 1).Margin(0, 1).Background(colors.Gray) } + popupStyle = func() lipgloss.Style { + return lipgloss.NewStyle(). + Background(colors.Background).Foreground(colors.White). + BorderBackground(colors.Background).BorderForeground(colors.White). + Border(lipgloss.ThickBorder()) + } + choiceSelectedStyle = func() lipgloss.Style { + return lipgloss.NewStyle().Padding(0, 1).Margin(0, 1).Background(colors.Blue).MarginBackground(colors.Background) + } + choiceUnselectedStyle = func() lipgloss.Style { + return lipgloss.NewStyle().Padding(0, 1).Margin(0, 1).Background(colors.Gray).MarginBackground(colors.Background) + } centerStyle = lipgloss.NewStyle().Width(authWidth).AlignHorizontal(lipgloss.Center) ) diff --git a/internal/client/ui/choicepopup/choicepopup.go b/internal/client/ui/choicepopup/choicepopup.go index b490693..3377f7a 100644 --- a/internal/client/ui/choicepopup/choicepopup.go +++ b/internal/client/ui/choicepopup/choicepopup.go @@ -60,7 +60,9 @@ func (m Model) View() string { paddingSize := m.Width - leftWidth - rightWidth assert.Assert(paddingSize >= 0, "there should be enough space for all choices", "remaining", paddingSize) - padding := strings.Repeat(" ", paddingSize) + padding := lipgloss.NewStyle(). + Background(m.Style.GetBackground()). + Render(strings.Repeat(" ", paddingSize)) choices := lipgloss.JoinHorizontal(lipgloss.Center, left, padding, right) styledChoices := m.ChoicesStyle.MaxWidth(m.Width).MaxHeight(m.Height).Render(choices) -- cgit v1.3.1