From 567b778645113721822df45824a43b73281fe40e Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Tue, 5 Aug 2025 23:19:54 -0400 Subject: [PATCH] chore(list): set selection colors --- internal/tui/exp/list/list.go | 6 +++++- internal/tui/styles/charmtone.go | 3 +++ internal/tui/styles/theme.go | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/tui/exp/list/list.go b/internal/tui/exp/list/list.go index 4a9db7351ef561ec14414e4f70f1973f3d207064..d40f8d26128eef0d6930ff598c4aa21b971fd75e 100644 --- a/internal/tui/exp/list/list.go +++ b/internal/tui/exp/list/list.go @@ -415,8 +415,12 @@ func (l *list[T]) selectionView(view string, textOnly bool) string { continue } + // Text selection styling, which is a Lip Gloss style. We must + // extract the values to use in a UV style, below. + ts := t.TextSelection + cell = cell.Clone() - cell.Style = cell.Style.Background(t.BgOverlay).Foreground(t.White) + cell.Style = cell.Style.Background(ts.GetBackground()).Foreground(ts.GetForeground()) scr.SetCell(x, y, cell) } } diff --git a/internal/tui/styles/charmtone.go b/internal/tui/styles/charmtone.go index cf3d6a092e88fa7832e7eda57c6e10be328c075b..2e3783f522eac79cd1feb432fe0e399be0802882 100644 --- a/internal/tui/styles/charmtone.go +++ b/internal/tui/styles/charmtone.go @@ -56,6 +56,9 @@ func NewCharmtoneTheme() *Theme { Cherry: charmtone.Cherry, } + // Text selection. + t.TextSelection = lipgloss.NewStyle().Foreground(charmtone.Salt).Background(charmtone.Charple) + // LSP and MCP status. t.ItemOfflineIcon = lipgloss.NewStyle().Foreground(charmtone.Squid).SetString("●") t.ItemBusyIcon = t.ItemOfflineIcon.Foreground(charmtone.Citron) diff --git a/internal/tui/styles/theme.go b/internal/tui/styles/theme.go index 706bd199491daaff525b13dd808a52dae5f359eb..0503539ba720188a0894d26abd299b54d602494e 100644 --- a/internal/tui/styles/theme.go +++ b/internal/tui/styles/theme.go @@ -74,6 +74,9 @@ type Theme struct { RedLight color.Color Cherry color.Color + // Text selection. + TextSelection lipgloss.Style + // LSP and MCP status indicators. ItemOfflineIcon lipgloss.Style ItemBusyIcon lipgloss.Style