add keymap
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
jjohnstondev 2023-01-08 23:27:53 -08:00
parent 0e11e3734f
commit 94ae6af7f1
2 changed files with 12 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import (
"gospt/internal/commands"
"gospt/internal/gctx"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
@ -134,6 +135,11 @@ func DisplayList(ctx *gctx.Context, client *spotify.Client) error {
ctx: ctx,
client: client,
}
m.list.AdditionalShortHelpKeys = func() []key.Binding {
return []key.Binding{
key.NewBinding(key.WithKeys("ctrl", "r"), key.WithHelp("ctrl+r", "start radio")),
}
}
m.list.Title = "Saved Tracks"
p := tea.NewProgram(m, tea.WithAltScreen(), tea.WithMouseCellMotion())

View File

@ -8,6 +8,7 @@ import (
"gospt/internal/commands"
"gospt/internal/gctx"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/zmb3/spotify/v2"
@ -135,7 +136,11 @@ func PlaylistTracks(ctx *gctx.Context, client *spotify.Client, playlist spotify.
playlist: playlist,
}
m.list.Title = playlist.Name
m.list.AdditionalShortHelpKeys = func() []key.Binding {
return []key.Binding{
key.NewBinding(key.WithKeys("ctrl", "r"), key.WithHelp("ctrl+r", "start radio")),
}
}
p := tea.NewProgram(m, tea.WithAltScreen(), tea.WithMouseCellMotion())
if _, err := p.Run(); err != nil {