on main help sign in
chore(list): set selection colors
commit567b778645113721822df45824a43b73281fe40e authorChristian Rocha <christian@rocha.is> dateTue 5 Aug 2025, 23:19 (1 year ago) parent0a278fa
3 files changed+11−1
internal/tui/exp/list/list.go+5−1 internal/tui/styles/charmtone.go+3 internal/tui/styles/theme.go+3
internal/tui/exp/list/list.go+5−1
@@ -415,8 +415,12 @@ func (l *list[T]) selectionView(view string, textOnly bool) string {
415415 continue
416416 }
417417
418+ // Text selection styling, which is a Lip Gloss style. We must
419+ // extract the values to use in a UV style, below.
420+ ts := t.TextSelection
421+
418422 cell = cell.Clone()
419− cell.Style = cell.Style.Background(t.BgOverlay).Foreground(t.White)
423+ cell.Style = cell.Style.Background(ts.GetBackground()).Foreground(ts.GetForeground())
420424 scr.SetCell(x, y, cell)
421425 }
422426 }
internal/tui/styles/charmtone.go+3
@@ -56,6 +56,9 @@ func NewCharmtoneTheme() *Theme {
5656 Cherry: charmtone.Cherry,
5757 }
5858
59+ // Text selection.
60+ t.TextSelection = lipgloss.NewStyle().Foreground(charmtone.Salt).Background(charmtone.Charple)
61+
5962 // LSP and MCP status.
6063 t.ItemOfflineIcon = lipgloss.NewStyle().Foreground(charmtone.Squid).SetString("●")
6164 t.ItemBusyIcon = t.ItemOfflineIcon.Foreground(charmtone.Citron)
internal/tui/styles/theme.go+3
@@ -74,6 +74,9 @@ type Theme struct {
7474 RedLight color.Color
7575 Cherry color.Color
7676
77+ // Text selection.
78+ TextSelection lipgloss.Style
79+
7780 // LSP and MCP status indicators.
7881 ItemOfflineIcon lipgloss.Style
7982 ItemBusyIcon lipgloss.Style