Documentation ¶
Index ¶
- type ErrorModel
- type HeaderModel
- type LoadingModel
- type Model
- type SearchModel
- type SelectorModel
- func (m *SelectorModel[T]) Blur()
- func (m *SelectorModel[T]) Focus()
- func (m SelectorModel[T]) Focused() bool
- func (m SelectorModel[T]) Init() tea.Cmd
- func (m SelectorModel[T]) Selection() T
- func (m SelectorModel[T]) Update(msg tea.Msg) (SelectorModel[T], tea.Cmd)
- func (m SelectorModel[T]) View() string
- type StationsModel
- type StringRenderable
- type Theme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorModel ¶
type ErrorModel struct {
// contains filtered or unexported fields
}
func NewErrorModel ¶
func NewErrorModel(theme Theme, err string) ErrorModel
func (ErrorModel) Init ¶
func (m ErrorModel) Init() tea.Cmd
func (*ErrorModel) SetWidthAndHeight ¶
func (m *ErrorModel) SetWidthAndHeight(width int, height int)
func (ErrorModel) View ¶
func (m ErrorModel) View() string
type HeaderModel ¶ added in v0.3.0
type HeaderModel struct {
// contains filtered or unexported fields
}
func NewHeaderModel ¶ added in v0.3.0
func NewHeaderModel(theme Theme, playbackManager playback.PlaybackManagerService) HeaderModel
func (HeaderModel) Init ¶ added in v0.3.0
func (m HeaderModel) Init() tea.Cmd
func (HeaderModel) View ¶ added in v0.3.0
func (m HeaderModel) View() string
type LoadingModel ¶
type LoadingModel struct {
// contains filtered or unexported fields
}
func NewLoadingModel ¶
func NewLoadingModel( theme Theme, browser api.RadioBrowserService, query common.StationQuery, queryText string, ) LoadingModel
func (LoadingModel) Init ¶
func (m LoadingModel) Init() tea.Cmd
func (*LoadingModel) SetWidthAndHeight ¶
func (m *LoadingModel) SetWidthAndHeight(width int, height int)
func (LoadingModel) View ¶
func (m LoadingModel) View() string
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func NewModel ¶
func NewModel( config config.Config, browser api.RadioBrowserService, playbackManager playback.PlaybackManagerService, ) Model
type SearchModel ¶
type SearchModel struct {
// contains filtered or unexported fields
}
func NewSearchModel ¶
func NewSearchModel(theme Theme) SearchModel
func (SearchModel) Init ¶
func (m SearchModel) Init() tea.Cmd
func (*SearchModel) SetWidthAndHeight ¶
func (m *SearchModel) SetWidthAndHeight(width int, height int)
func (SearchModel) View ¶
func (m SearchModel) View() string
type SelectorModel ¶
type SelectorModel[T StringRenderable] struct { // contains filtered or unexported fields }
func NewSelectorModel ¶
func NewSelectorModel[T StringRenderable](theme Theme, title string, items []T, initialSelection int) SelectorModel[T]
func (*SelectorModel[T]) Blur ¶
func (m *SelectorModel[T]) Blur()
func (*SelectorModel[T]) Focus ¶
func (m *SelectorModel[T]) Focus()
func (SelectorModel[T]) Focused ¶
func (m SelectorModel[T]) Focused() bool
func (SelectorModel[T]) Init ¶
func (m SelectorModel[T]) Init() tea.Cmd
func (SelectorModel[T]) Selection ¶
func (m SelectorModel[T]) Selection() T
func (SelectorModel[T]) Update ¶
func (m SelectorModel[T]) Update(msg tea.Msg) (SelectorModel[T], tea.Cmd)
func (SelectorModel[T]) View ¶
func (m SelectorModel[T]) View() string
type StationsModel ¶
type StationsModel struct {
// contains filtered or unexported fields
}
func NewStationsModel ¶
func NewStationsModel( theme Theme, browser api.RadioBrowserService, playbackManager playback.PlaybackManagerService, stations []common.Station, ) StationsModel
func (StationsModel) Init ¶
func (m StationsModel) Init() tea.Cmd
func (*StationsModel) SetWidthAndHeight ¶
func (m *StationsModel) SetWidthAndHeight(width int, height int)
func (StationsModel) View ¶
func (m StationsModel) View() string
type StringRenderable ¶
type StringRenderable interface {
Render() string
}
type Theme ¶ added in v0.2.0
type Theme struct { PrimaryBlock lipgloss.Style SecondaryBlock lipgloss.Style Text lipgloss.Style PrimaryText lipgloss.Style SecondaryText lipgloss.Style TertiaryText lipgloss.Style ErrorText lipgloss.Style StationsTableStyle table.Styles }
Theme represents a style configuration for the application.
func (Theme) StyleBottomBar ¶ added in v0.2.0
StyleBottomBar returns a string representing the styled bottom bar of the given Theme. It takes a slice of strings representing the commands to be displayed in the bottom bar. The function iterates over the commands and applies a different style to each one based on its index. If the index is even, the command is styled with the primary color of the Theme as background. If the index is odd, the command is styled with the secondary color of the Theme as background. The styled commands are concatenated into a single string and returned.
Click to show internal directories.
Click to hide internal directories.