Commit 2be3c42c73

2be3c42c73c6bd780e47de3efb91899467425208

parent: c431f1bac4

Unsigned

Wraient <wraient.911@gmail.com> · 2025-01-23 20:40 UTC

Add: Better colours??

Layout: unified · split

internal/selection_menu.go +11 −10
@@ -49,13 +49,16 @@ var (
4949 Foreground(lipgloss.Color("#98FB98")) // Pale green
5050
5151 selectedItemStyle = lipgloss.NewStyle().
52 Foreground(lipgloss.Color("#000000")). // Black text
53 Background(lipgloss.Color("#7CB9E8")). // Light blue background
52 Foreground(lipgloss.Color("#FFFFFF")). // White text
53 Background(lipgloss.Color("#4A90E2")). // Softer blue background
5454 Bold(true).
55 Padding(0, 1)
55 Padding(0, 1).
56 Border(lipgloss.NormalBorder(), false, false, false, true). // Left border only
57 BorderForeground(lipgloss.Color("#FFFFFF")) // White border
5658
5759 regularItemStyle = lipgloss.NewStyle().
58 Foreground(lipgloss.Color("#E6E6FA")) // Light lavender
60 Foreground(lipgloss.Color("#E6E6FA")). // Light lavender
61 Padding(0, 1)
5962
6063 noMatchesStyle = lipgloss.NewStyle().
6164 Foreground(lipgloss.Color("#FF6B6B")). // Coral red
@@ -145,14 +148,12 @@ func (m Model) View() string {
145148 quitHintStyle.Render("Ctrl+C") + " to quit):\n")
146149
147150 b.WriteString(filterLabelStyle.Render("Filter: ") +
148 filterTextStyle.Render(m.filter) + "\n")
151 filterTextStyle.Render(m.filter) + "\n\n") // Added extra newline for spacing
149152
150153 if len(m.filteredKeys) == 0 {
151 b.WriteString("\n" + noMatchesStyle.Render("No matches found.") + "\n")
154 b.WriteString(noMatchesStyle.Render("No matches found.") + "\n")
152155 } else {
153156 visibleItems := m.visibleItemsCount()
154
155 // Determine the slice of items to display based on scroll offset
156157 start := m.scrollOffset
157158 end := start + visibleItems
158159 if end > len(m.filteredKeys) {
@@ -162,9 +163,9 @@ func (m Model) View() string {
162163 // Render the options within the visible range
163164 for i := start; i < end; i++ {
164165 if i == m.selected {
165 b.WriteString(selectedItemStyle.Render("▶ "+m.filteredKeys[i].Label) + "\n")
166 b.WriteString(selectedItemStyle.Render(m.filteredKeys[i].Label) + "\n")
166167 } else {
167 b.WriteString(regularItemStyle.Render(" "+m.filteredKeys[i].Label) + "\n")
168 b.WriteString(regularItemStyle.Render(m.filteredKeys[i].Label) + "\n")
168169 }
169170 }
170171 }