tui

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BorderHeightOverhead = 4 // top border(1) + top padding(1) + bottom padding(1) + bottom border(1)
	BorderWidthOverhead  = 8 // left border(1) + left padding(3) + right padding(3) + right border(1)
)

Border overhead constants (border line + padding on each side).

Variables

View Source
var (
	ColorPrimary   = lipgloss.Color("#7C3AED")
	ColorSecondary = lipgloss.Color("#10B981")
	ColorAccent    = lipgloss.Color("#F59E0B")
	ColorError     = lipgloss.Color("#EF4444")
	ColorMuted     = lipgloss.Color("#6B7280")
	ColorDim       = lipgloss.Color("#5A6370")
	ColorBorder    = lipgloss.Color("#374151")
	ColorLink      = lipgloss.Color("#3B82F6")
	ColorSuccess   = lipgloss.Color("#22C55E")
)

Colors for the application.

View Source
var BorderStyleNames = []string{"none", "rounded", "thick", "double", "block"}

BorderStyleNames lists all available border styles for cycling in settings.

View Source
var DateFormatNames = []string{"YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY"}

DateFormatNames lists the available date format options.

View Source
var ListDensityNames = []string{"compact", "normal", "relaxed"}

ListDensityNames lists all available list density options for cycling in settings.

View Source
var SelectionNames = []string{"none", "wave", "blink", "glitch"}

SelectionNames lists all available selection animation types for cycling in settings.

View Source
var ThemeNames = []string{"default", "blue", "orange", "green"}

ThemeNames is the ordered list of theme names for cycling.

View Source
var TransitionNames = []string{"none", "fade", "glitch", "dissolve", "sweep", "lines", "lines-cross", "random"}

TransitionNames lists all available transition types for cycling in settings.

View Source
var Version = "dev"

Functions

func ApplyTheme

func ApplyTheme(theme string)

ApplyTheme updates the package-level color variables based on the theme.

func HasBorder

func HasBorder(style string) bool

HasBorder returns true if the given border style is not "none" or empty.

Types

type CollectionStatus added in v0.3.1

type CollectionStatus int

CollectionStatus represents a BGG collection status type.

const (
	StatusOwned CollectionStatus = iota
	StatusPrevOwned
	StatusForTrade
	StatusWant
	StatusWantToPlay
	StatusWantToBuy
	StatusWishlist
	StatusPreordered
)

type KeyMap

type KeyMap struct {
	Up           key.Binding
	Down         key.Binding
	Enter        key.Binding
	Back         key.Binding
	Escape       key.Binding
	Quit         key.Binding
	Help         key.Binding
	Search       key.Binding
	Hot          key.Binding
	Collect      key.Binding
	Settings     key.Binding
	NextPage     key.Binding
	PrevPage     key.Binding
	Forum        key.Binding
	Open         key.Binding
	Refresh      key.Binding
	User         key.Binding
	Filter       key.Binding
	Sort         key.Binding
	StatusFilter key.Binding
}

KeyMap defines the key bindings for the application.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default key bindings.

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

FullHelp returns the full help text for the key bindings.

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

ShortHelp returns the short help text for the key bindings.

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the main application model.

func New

func New(cfg *config.Config) Model

New creates a new application model.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

type Protocol

type Protocol int

Protocol represents the image display protocol.

const (
	ProtocolNone Protocol = iota
	ProtocolKitty
)

type Styles

type Styles struct {
	Title         lipgloss.Style
	Subtitle      lipgloss.Style
	MenuItem      lipgloss.Style
	MenuItemFocus lipgloss.Style
	ListItem      lipgloss.Style
	ListItemFocus lipgloss.Style
	Help          lipgloss.Style
	Error         lipgloss.Style
	Loading       lipgloss.Style
	Border        lipgloss.Style
	Rating        lipgloss.Style
	Rank          lipgloss.Style
	Players       lipgloss.Style
	Time          lipgloss.Style
	Label         lipgloss.Style
}

Styles contains all the styles used in the application.

func NewStyles

func NewStyles(theme string) Styles

NewStyles returns styles for the application based on the given theme.

type ThemePalette

type ThemePalette struct {
	Primary   lipgloss.Color
	Secondary lipgloss.Color
	Accent    lipgloss.Color
	Error     lipgloss.Color
	Muted     lipgloss.Color
	Dim       lipgloss.Color
	Border    lipgloss.Color
	Link      lipgloss.Color
	Success   lipgloss.Color
}

ThemePalette defines the color palette for a theme.

type View

type View int

View represents the current view state of the application.

const (
	ViewMenu View = iota
	ViewSearchInput
	ViewSearchResults
	ViewHot
	ViewCollectionInput
	ViewCollectionList
	ViewDetail
	ViewForumList
	ViewThreadList
	ViewThreadView
	ViewSettings
	ViewSetupToken
)

func (View) String

func (v View) String() string

String returns the string representation of a View.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL