From 03c1f3095af847a2177f791a36c1864fef01825a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= <1224732+snonux@users.noreply.github.com> Date: Sat, 21 Jun 2025 22:53:35 +0300 Subject: make colors configurable and add theme hotkeys --- internal/atable/table.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'internal/atable') diff --git a/internal/atable/table.go b/internal/atable/table.go index 528276f..c22d479 100644 --- a/internal/atable/table.go +++ b/internal/atable/table.go @@ -118,17 +118,19 @@ func DefaultKeyMap() KeyMap { // Styles contains style definitions for this list component. By default, these // values are generated by DefaultStyles. type Styles struct { - Header lipgloss.Style - Cell lipgloss.Style - Selected lipgloss.Style + Header lipgloss.Style + Cell lipgloss.Style + Selected lipgloss.Style + Highlight lipgloss.Style } // DefaultStyles returns a set of default style definitions for this table. func DefaultStyles() Styles { return Styles{ - Selected: lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("212")), - Header: lipgloss.NewStyle().Bold(true).Padding(0, 1), - Cell: lipgloss.NewStyle().Padding(0, 1), + Selected: lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("212")), + Header: lipgloss.NewStyle().Bold(true).Padding(0, 1), + Cell: lipgloss.NewStyle().Padding(0, 1), + Highlight: lipgloss.NewStyle().Background(lipgloss.Color("57")).Foreground(lipgloss.Color("0")), } } @@ -479,10 +481,7 @@ func (m *Model) renderRow(r int) string { highlightRow := r == m.cursor rowStyle := m.styles.Cell if highlightRow { - rowStyle = rowStyle. - Background(lipgloss.Color("57")). - Foreground(lipgloss.Color("0")). - Bold(false) + rowStyle = m.styles.Highlight } s := make([]string, 0, len(m.cols)) -- cgit v1.2.3