diff options
| author | Paul Bütow <1224732+snonux@users.noreply.github.com> | 2025-06-21 22:53:35 +0300 |
|---|---|---|
| committer | Paul Bütow <1224732+snonux@users.noreply.github.com> | 2025-06-21 22:53:35 +0300 |
| commit | 03c1f3095af847a2177f791a36c1864fef01825a (patch) | |
| tree | 64f8e41d8f54dc6bbcd74e7897f4157e786d8586 /internal/atable | |
| parent | 2234198b6f603240ed81f7656449cc6a319de701 (diff) | |
make colors configurable and add theme hotkeys
Diffstat (limited to 'internal/atable')
| -rw-r--r-- | internal/atable/table.go | 19 |
1 files changed, 9 insertions, 10 deletions
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)) |
