themepicker

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package themepicker is File > Settings > Theme: every theme in a picker, fuzzy searched by name, narrowed to one kind by a search starting with "dark" or "light". The highlighted theme is drawn live; Enter keeps it, Esc goes back to the theme there was. It knows the UI only through Host, which draws and saves themes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host interface {
	picker.Host
	// Current is the theme configured for the terminal's background.
	Current() string
	// ThemesDir is where the user's own themes are.
	ThemesDir() string
	// Preview draws the theme named name; "" goes back to the configured
	// one.
	Preview(name string)
	// Keep closes the picker and makes name the theme, saving it.
	Keep(name string)
	// KeyReleases reports whether the terminal says when a key is let
	// go (the kitty keyboard protocol), so Space can be held to peek.
	KeyReleases() bool
}

Host is what the theme picker needs of the UI: a picker's host, and the themes.

type Picker

type Picker struct {
	*picker.Picker
	// contains filtered or unexported fields
}

Picker is the open theme picker.

func New

func New(h Host) *Picker

New returns a picker of every theme with the current one highlighted and drawn.

func (*Picker) Changed

func (tp *Picker) Changed()

func (*Picker) Cursor added in v0.3.0

func (tp *Picker) Cursor() (int, int)

func (*Picker) Key

func (tp *Picker) Key(k tea.KeyPressMsg) tea.Cmd

func (*Picker) Layout added in v0.3.0

func (tp *Picker) Layout() []overlay.Box

func (*Picker) Mouse

func (tp *Picker) Mouse(e overlay.MouseEvent) tea.Cmd

func (*Picker) Release added in v0.3.0

func (tp *Picker) Release(k tea.KeyReleaseMsg) tea.Cmd

Release ends a hold of Space.

func (*Picker) Status added in v0.3.0

func (tp *Picker) Status() (string, string)

Jump to

Keyboard shortcuts

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