gospt/internal/tui/constants.go
jjohnstondev e74a71749d
All checks were successful
continuous-integration/drone/tag Build is passing
make tui better
2023-01-09 10:55:18 -08:00

53 lines
1.0 KiB
Go

package tui
import (
"github.com/charmbracelet/bubbles/key"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/zmb3/spotify"
)
var (
P *tea.Program
Client *spotify.Client
WindowSize tea.WindowSizeMsg
)
var DocStyle = lipgloss.NewStyle().Margin(0, 2)
var HelpStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("241")).Render
var ErrStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#bd534b")).Render
var AlertStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("62")).Render
type keymap struct {
Radio key.Binding
Enter key.Binding
Rename key.Binding
Delete key.Binding
Back key.Binding
Quit key.Binding
}
var Keymap = keymap{
Radio: key.NewBinding(
key.WithKeys("ctrl+r"),
key.WithHelp("ctrl+r", "start radio"),
),
Enter: key.NewBinding(
key.WithKeys("enter"),
key.WithHelp("enter", "select"),
),
Back: key.NewBinding(
key.WithKeys("esc"),
key.WithHelp("esc", "back"),
),
Quit: key.NewBinding(
key.WithKeys("ctrl+c", "q"),
key.WithHelp("ctrl+c/q", "quit"),
),
}