category

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeymap = Keymap{
	SelectFeed: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("Enter", "Open"),
	),
	NewFeed: key.NewBinding(
		key.WithKeys("n", "ctrl+n"),
		key.WithHelp("n/C-n", "New"),
	),
	EditFeed: key.NewBinding(
		key.WithKeys("e", "ctrl+e"),
		key.WithHelp("e/C-e", "Edit"),
	),
	DeleteFeed: key.NewBinding(
		key.WithKeys("d", "ctrl+d"),
		key.WithHelp("d/C-d", "Delete"),
	),
}

DefaultKeymap contains the default key bindings for this tab

Functions

This section is empty.

Types

type ChosenCategoryMsg added in v1.1.0

type ChosenCategoryMsg struct {
	Name    string
	Desc    string
	OldName string
	IsEdit  bool
}

ChosenCategoryMsg is the message displayed when a category is successfully chosen.

type Keymap added in v1.1.0

type Keymap struct {
	SelectFeed key.Binding
	NewFeed    key.Binding
	EditFeed   key.Binding
	DeleteFeed key.Binding
}

Keymap contains the key bindings for this tab

func (Keymap) FullHelp added in v1.1.0

func (k Keymap) FullHelp() [][]key.Binding

FullHelp returns the full help for this tab

func (Keymap) ShortHelp added in v1.1.0

func (k Keymap) ShortHelp() []key.Binding

ShortHelp returns the short help for this tab

type Model

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

Model contains the state of this tab

func New

func New(colors colorscheme.Colorscheme, width, height int, title string, reader func(string) tea.Cmd) Model

New creates a new category tab with sensible defaults

func (Model) GetKeyBinds added in v1.2.0

func (m Model) GetKeyBinds() []key.Binding

GetKeyBinds returns the key bindings of the tab

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the tab

func (Model) SetSize added in v1.0.4

func (m Model) SetSize(width, height int) tab.Tab

SetSize sets the dimensions of the tab

func (Model) Style added in v1.2.0

func (m Model) Style() tab.Style

Style returns the style of the tab

func (Model) Title

func (m Model) Title() string

Title returns the title of the tab

func (Model) Update

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

Update updates the variables of the tab

func (Model) View

func (m Model) View() string

View returns the view of the tab

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

Popup is the category popup where a user can create a category.

func NewPopup added in v1.1.0

func NewPopup(colors colorscheme.Colorscheme, bgRaw string, width, height int, oldName, oldDesc string) Popup

NewPopup creates a new popup window in which the user can choose a new category.

func (Popup) Init added in v1.1.0

func (p Popup) Init() tea.Cmd

Init the popup window.

func (Popup) Update added in v1.1.0

func (p Popup) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update the popup window.

func (Popup) View added in v1.1.0

func (p Popup) View() string

View renders the popup window.

Jump to

Keyboard shortcuts

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