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 ¶
- type Host
- type Picker
- func (tp *Picker) Changed()
- func (tp *Picker) Cursor() (int, int)
- func (tp *Picker) Key(k tea.KeyPressMsg) tea.Cmd
- func (tp *Picker) Layout() []overlay.Box
- func (tp *Picker) Mouse(e overlay.MouseEvent) tea.Cmd
- func (tp *Picker) Release(k tea.KeyReleaseMsg) tea.Cmd
- func (tp *Picker) Status() (string, string)
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.
Click to show internal directories.
Click to hide internal directories.