themepicker

package
v0.0.0-...-692cb10 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchRemote

func FetchRemote(localKeys map[string]bool) tea.Cmd

FetchRemote returns a command that fetches remote themes from GitHub. localKeys are theme keys already present locally (to avoid duplicates).

Types

type DismissMsg

type DismissMsg struct{}

DismissMsg is sent when the user closes the theme picker without selecting.

type Model

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

Model is the theme picker overlay.

func New

func New(available []theme.AvailableTheme, width, height int) Model

New creates a new theme picker overlay.

func (Model) BoxSize

func (m Model) BoxSize(screenWidth, screenHeight int) (int, int)

BoxSize returns desired box dimensions.

func (*Model) HandleRemote

func (m *Model) HandleRemote(msg RemoteThemesMsg)

HandleRemote merges remote themes into the picker's entries.

func (Model) Update

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

Update handles key events.

func (Model) View

func (m Model) View(th theme.Theme, screenWidth, screenHeight int) string

View renders the theme picker as a floating box.

type PreviewMsg

type PreviewMsg struct{ Theme theme.Theme }

PreviewMsg is sent when the user navigates to a theme (for live preview).

type RemoteThemesMsg

type RemoteThemesMsg struct {
	Themes []theme.AvailableTheme
}

RemoteThemesMsg delivers themes fetched from GitHub.

type SelectMsg

type SelectMsg struct {
	Key     string // config key (filename stem)
	Source  string // theme.SourceDefault, SourceLocal, or SourceRemote
	RawTOML []byte // non-nil for remote themes (written to disk on select)
	Theme   theme.Theme
}

SelectMsg is sent when the user confirms a theme selection.

Jump to

Keyboard shortcuts

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