make tui better
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
jjohnstondev 2023-01-09 10:55:18 -08:00
parent 188404ac4f
commit e74a71749d

View File

@ -7,29 +7,20 @@ import (
"github.com/zmb3/spotify" "github.com/zmb3/spotify"
) )
/* CONSTANTS */
var ( var (
// P the current tea program
P *tea.Program P *tea.Program
// client
Client *spotify.Client Client *spotify.Client
// WindowSize store the size of the terminal window
WindowSize tea.WindowSizeMsg WindowSize tea.WindowSizeMsg
) )
/* STYLING */
// DocStyle styling for viewports
var DocStyle = lipgloss.NewStyle().Margin(0, 2) var DocStyle = lipgloss.NewStyle().Margin(0, 2)
// HelpStyle styling for help context menu
var HelpStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("241")).Render var HelpStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("241")).Render
// ErrStyle provides styling for error messages
var ErrStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#bd534b")).Render var ErrStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#bd534b")).Render
// AlertStyle provides styling for alert messages
var AlertStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("62")).Render var AlertStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("62")).Render
type keymap struct { type keymap struct {
@ -41,11 +32,10 @@ type keymap struct {
Quit key.Binding Quit key.Binding
} }
// Keymap reusable key mappings shared across models
var Keymap = keymap{ var Keymap = keymap{
Radio: key.NewBinding( Radio: key.NewBinding(
key.WithKeys("ctrl+r"), key.WithKeys("ctrl+r"),
key.WithHelp("ctrl+r", "create"), key.WithHelp("ctrl+r", "start radio"),
), ),
Enter: key.NewBinding( Enter: key.NewBinding(
key.WithKeys("enter"), key.WithKeys("enter"),