themepicker

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Keys = &KeyMap{
	Up: key.NewBinding(
		key.WithKeys("up", "ctrl+p"),
		key.WithHelp("↑/ctrl+p", "prev theme"),
	),
	Down: key.NewBinding(
		key.WithKeys("down", "ctrl+n"),
		key.WithHelp("↓/ctrl+n", "next theme"),
	),
	Select: key.NewBinding(
		key.WithKeys("enter", "ctrl+y"),
		key.WithHelp("enter", "choose"),
	),
}

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	Up     key.Binding
	Down   key.Binding
	Select key.Binding
}

type ListItem

type ListItem interface {
	list.FilterableItem
	list.Focusable
	list.MatchSettable

	// ID returns the unique identifier of the item.
	ID() string
}

ListItem represents a selectable and searchable item in a dialog list.

type ListItemStyles

type ListItemStyles struct {
	ItemBlurred     lipgloss.Style
	ItemFocused     lipgloss.Style
	InfoTextBlurred lipgloss.Style
	InfoTextFocused lipgloss.Style
}

type Model

type Model struct {
	common.Common
	common.Component
	// contains filtered or unexported fields
}

func New

func New(styles *common.Styles) Model

func (*Model) Open

func (m *Model) Open() tea.Cmd

func (*Model) Selected

func (m *Model) Selected() string

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type ThemeChosenMsg

type ThemeChosenMsg struct {
	Theme *tint.Tint
}

type ThemePreviewMsg

type ThemePreviewMsg struct {
	Theme *tint.Tint
}

type TintItem

type TintItem struct {
	*list.Versioned
	// contains filtered or unexported fields
}

TintItem wraps a uicmd.Command to implement the ListItem interface.

func NewThemeItem

func NewThemeItem(
	t *common.Styles,
	id, title string,
	tint *tint.Tint,
) *TintItem

func (*TintItem) Filter

func (ti *TintItem) Filter() string

Filter implements ListItem.

func (*TintItem) Finished

func (ti *TintItem) Finished() bool

Finished implements list.Item. Command items are render-stable outside of explicit SetFocused / SetMatch.

func (*TintItem) ID

func (ti *TintItem) ID() string

ID implements ListItem.

func (*TintItem) Render

func (ti *TintItem) Render(width int) string

Render implements ListItem.

func (*TintItem) SetFocused

func (ti *TintItem) SetFocused(focused bool)

SetFocused implements ListItem.

func (*TintItem) SetHideInfo

func (ti *TintItem) SetHideInfo(v bool)

SetHideInfo controls whether the hint column is shown. The dialog hides it uniformly when it would crowd the command names.

func (*TintItem) SetMatch

func (ti *TintItem) SetMatch(m fuzzy.Match)

SetMatch implements ListItem.

func (*TintItem) Tint

func (ti *TintItem) Tint() *tint.Tint

func (*TintItem) WithAliases

func (ti *TintItem) WithAliases(aliases ...string) *TintItem

WithAliases returns the TintItem with the given aliases for filtering.

Jump to

Keyboard shortcuts

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