feat: the selected row is a shade of the terminal's background
lazysecrets asks the terminal for its background and shades the selection from it, a little lighter on a dark background and darker on a light one, where palette 8 was often too bright to read coloured rows on. Palette 8 stays until the terminal answers, or if it doesn't, and a theme's selection colours still win. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b95eeb725b
commit
9963615e51
4 files changed
+64
-2
No files matched your search
@@ -489,7 +489,7 @@ func (m *Model) setVersions(items []provider.Object) {
|
||||
}
|
||||
|
||||
func (m Model) Init() tea.Cmd {
|
||||
cmds := []tea.Cmd{m.sourcesCmd(), m.spin.Tick, m.checkClipboard()}
|
||||
cmds := []tea.Cmd{m.sourcesCmd(), m.spin.Tick, m.checkClipboard(), tea.RequestBackgroundColor}
|
||||
if m.cachePath != "" || m.placeDir != "" {
|
||||
cmds = append(cmds, tea.Tick(persistEvery, func(time.Time) tea.Msg { return persistTickMsg{} }))
|
||||
}
|
||||
@@ -514,6 +514,9 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
var cmds []tea.Cmd
|
||||
|
||||
switch msg := msg.(type) {
|
||||
case tea.BackgroundColorMsg:
|
||||
m.st = m.st.OnBackground(msg.Color, msg.IsDark())
|
||||
return m, nil
|
||||
case tea.WindowSizeMsg:
|
||||
m.w, m.h = msg.Width, msg.Height
|
||||
|
||||
|
||||
Reference in new issue
Block a user