on main help sign in
chore(list): set selection colors
567b778Christian Rocha
internal/tui/exp/list/list.go+5−1
@@ -415,8 +415,12 @@ func (l *list[T]) selectionView(view string, textOnly bool) string {
415 continue
415 continue
416 }
416 }
417
417
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+
418 cell = cell.Clone()
422 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())
420 scr.SetCell(x, y, cell)
424 scr.SetCell(x, y, cell)
421 }
425 }
422 }
426 }
internal/tui/styles/charmtone.go+3
@@ -56,6 +56,9 @@ func NewCharmtoneTheme() *Theme {
56 Cherry: charmtone.Cherry,
56 Cherry: charmtone.Cherry,
57 }
57 }
58
58
59+ // Text selection.
60+ t.TextSelection = lipgloss.NewStyle().Foreground(charmtone.Salt).Background(charmtone.Charple)
61+
59 // LSP and MCP status.
62 // LSP and MCP status.
60 t.ItemOfflineIcon = lipgloss.NewStyle().Foreground(charmtone.Squid).SetString("●")
63 t.ItemOfflineIcon = lipgloss.NewStyle().Foreground(charmtone.Squid).SetString("●")
61 t.ItemBusyIcon = t.ItemOfflineIcon.Foreground(charmtone.Citron)
64 t.ItemBusyIcon = t.ItemOfflineIcon.Foreground(charmtone.Citron)
internal/tui/styles/theme.go+3
@@ -74,6 +74,9 @@ type Theme struct {
74 RedLight color.Color
74 RedLight color.Color
75 Cherry color.Color
75 Cherry color.Color
76
76
77+ // Text selection.
78+ TextSelection lipgloss.Style
79+
77 // LSP and MCP status indicators.
80 // LSP and MCP status indicators.
78 ItemOfflineIcon lipgloss.Style
81 ItemOfflineIcon lipgloss.Style
79 ItemBusyIcon lipgloss.Style
82 ItemBusyIcon lipgloss.Style