tui

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Info status = iota
	Form
)

Variables

View Source
var (
	Subtle          = lipgloss.AdaptiveColor{Light: "#D9DCCF", Dark: "#383838"}
	ContainerNugget = lipgloss.NewStyle().
					PaddingRight(1).
					MarginRight(1)
	ContainerStyleNoBorder = ContainerNugget.Copy()
	ContainerStyle         = ContainerNugget.Copy().
							Border(lipgloss.RoundedBorder(), true)
	HelpContainerStyle = ContainerStyle.Copy()
	FocusedStyle       = ContainerNugget.Copy().
						Border(lipgloss.RoundedBorder(), true).
						BorderForeground(lipgloss.Color("1"))
	DetailsViewStyle = lipgloss.NewStyle().PaddingLeft(2).
						MarginRight(1)
	ListViewStyle = lipgloss.NewStyle()
	SpinnerStyle  = lipgloss.NewStyle().
					MarginLeft(1).
					MarginTop(1)
	StatusNugget = lipgloss.NewStyle().Foreground(lipgloss.Color("#FFFDF5")).Padding(0, 1).MarginLeft(1)
	NameStyle    = lipgloss.NewStyle().
					Foreground(lipgloss.AdaptiveColor{Light: "#343433", Dark: "#C1C6B2"}).
					Border(lipgloss.RoundedBorder(), true)
	TitleStyle = StatusNugget.Copy().Background(lipgloss.Color("4")).MarginTop(1).MarginBottom(1)
	ListTitle  = lipgloss.NewStyle().
				Bold(true).
				Background(lipgloss.Color("4")).Padding(0, 1)
	FormStyle = lipgloss.NewStyle().
				PaddingLeft(2).
				PaddingTop(1).
				MarginRight(1)
	InactiveStyle        = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
	ActiveStyle          = lipgloss.NewStyle().Foreground(lipgloss.Color("2"))
	CheckboxCheckedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("6"))
	OptionsViewStyle     = lipgloss.NewStyle()

	DialogBoxStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(lipgloss.Color("#874BFD")).
					Padding(1, 0).
					BorderTop(true).
					BorderLeft(true).
					BorderRight(true).
					BorderBottom(true)

	ButtonStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("#FFF7DB")).
				Background(lipgloss.Color("#888B7E")).
				Padding(0, 3).
				MarginTop(1)

	ActiveButtonStyle = ButtonStyle.Copy().
						Foreground(lipgloss.Color("#FFF7DB")).
						Background(lipgloss.Color("#F25D94")).
						Underline(true)

	ActiveRightButtonStyle = ActiveButtonStyle.Copy().
							MarginLeft(2)

	ActiveLeftButtonStyle = ActiveButtonStyle.Copy().
							MarginRight(2)
)
View Source
var DefaultFormKeyMap = FormKeyMap{
	Quit: key.NewBinding(
		key.WithKeys("ctrl+c"),
		key.WithHelp("ctrl+c", "quit"),
	),
	Tab: key.NewBinding(
		key.WithKeys("tab"),
		key.WithHelp("tab", "go to next field/submit"),
	),
	Back: key.NewBinding(
		key.WithKeys("esc"),
		key.WithHelp("esc", "go back"),
	),
	Up: key.NewBinding(
		key.WithKeys("up"),
		key.WithHelp("↑", "move up"),
	),
	Down: key.NewBinding(
		key.WithKeys("down"),
		key.WithHelp("↓", "move down"),
	),
	Enter: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "select option"),
	),
}
View Source
var DefaultKeyMap = KeyMap{
	Up: key.NewBinding(
		key.WithKeys("up"),
		key.WithHelp("↑", "move up"),
	),
	Down: key.NewBinding(
		key.WithKeys("down"),
		key.WithHelp("↓", "move down"),
	),
	Left: key.NewBinding(
		key.WithKeys("left"),
		key.WithHelp("←", "move left"),
	),
	Right: key.NewBinding(
		key.WithKeys("right"),
		key.WithHelp("→", "move right"),
	),
	Quit: key.NewBinding(
		key.WithKeys("q", "ctrl+c"),
		key.WithHelp("q/ctrl+c", "quit"),
	),
	Delete: key.NewBinding(
		key.WithKeys("d"),
		key.WithHelp("d", "delete download"),
	),
	Download: key.NewBinding(
		key.WithKeys("s"),
		key.WithHelp("s", "start download"),
	),
	Enter: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "show more info"),
	),
	Create: key.NewBinding(
		key.WithKeys("c"),
		key.WithHelp("c", "create new queued item"),
	),
}
View Source
var Models []tea.Model

MODEL MANAGMENT

Functions

func InitialModel

func InitialModel(cfg utils.Config) *model

Types

type FormKeyMap

type FormKeyMap struct {
	Quit  key.Binding
	Enter key.Binding
	Back  key.Binding
	Up    key.Binding
	Down  key.Binding
	Tab   key.Binding
}

FORM MODEL

type FormModel

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

func NewForm

func NewForm() *FormModel

func (FormModel) CreateQueuedItem

func (m FormModel) CreateQueuedItem() tea.Msg

func (FormModel) Init

func (m FormModel) Init() tea.Cmd

func (FormModel) Update

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

func (FormModel) View

func (m FormModel) View() string

type KeyMap

type KeyMap struct {
	Up       key.Binding
	Down     key.Binding
	Left     key.Binding
	Right    key.Binding
	Quit     key.Binding
	Download key.Binding
	Delete   key.Binding
	Enter    key.Binding
	Create   key.Binding
}

type QueueItem

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

func NewQueuedItem

func NewQueuedItem(videoId, outputName, audioFormat, extraCommands string, embedThumbnail, audioOnly bool) QueueItem

func (QueueItem) Description

func (i QueueItem) Description() string

func (QueueItem) FilterValue

func (i QueueItem) FilterValue() string

func (QueueItem) Title

func (i QueueItem) Title() string

Jump to

Keyboard shortcuts

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