summaryrefslogtreecommitdiff
path: root/internal/atable
diff options
context:
space:
mode:
Diffstat (limited to 'internal/atable')
-rw-r--r--internal/atable/table.go19
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))