| 1 | package tui |
| 2 | |
| 3 | import ( |
| 4 | "charm.land/bubbles/v2/list" |
| 5 | "charm.land/lipgloss/v2" |
| 6 | ) |
| 7 | |
| 8 | // ListIDStyle dims a trailing short-id segment in list item titles. |
| 9 | var ListIDStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("8")) |
| 10 | |
| 11 | // ANSIListDelegate returns the andromeda default list delegate (no description, |
| 12 | // no spacing, accent color "3"). |
| 13 | func ANSIListDelegate() list.DefaultDelegate { |
| 14 | d := list.NewDefaultDelegate() |
| 15 | d.ShowDescription = false |
| 16 | d.SetSpacing(0) |
| 17 | d.Styles.NormalTitle = lipgloss.NewStyle().Foreground(lipgloss.Color("7")).Padding(0, 0, 0, 2) |
| 18 | d.Styles.SelectedTitle = lipgloss.NewStyle(). |
| 19 | Foreground(lipgloss.Color("3")). |
| 20 | Bold(true). |
| 21 | Border(lipgloss.NormalBorder(), false, false, false, true). |
| 22 | BorderForeground(lipgloss.Color("3")). |
| 23 | Padding(0, 0, 0, 1) |
| 24 | d.Styles.DimmedTitle = lipgloss.NewStyle().Foreground(lipgloss.Color("8")).Padding(0, 0, 0, 2) |
| 25 | d.Styles.FilterMatch = lipgloss.NewStyle().Underline(true).Foreground(lipgloss.Color("3")) |
| 26 | return d |
| 27 | } |
| 28 | |
| 29 | // ANSIListStyles returns the andromeda default list.Styles. |
| 30 | func ANSIListStyles() list.Styles { |
| 31 | s := list.DefaultStyles(true) |
| 32 | s.Title = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("3")).Padding(0, 1) |
| 33 | s.TitleBar = lipgloss.NewStyle().Padding(0, 0, 1, 0) |
| 34 | s.NoItems = lipgloss.NewStyle().Foreground(lipgloss.Color("8")).Padding(0, 0, 0, 2) |
| 35 | s.DefaultFilterCharacterMatch = lipgloss.NewStyle().Underline(true).Foreground(lipgloss.Color("3")) |
| 36 | return s |
| 37 | } |