ui

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(slice []string, val string) bool

func GetPaneList

func GetPaneList(enabled_panes []string) []string

func HandleDelete

func HandleDelete(m *Model)

func HandleEscape

func HandleEscape(m *Model)

func HandleNew

func HandleNew(m *Model)

func HandleNextPane

func HandleNextPane(m *Model)

func HandlePreviousPane

func HandlePreviousPane(m *Model)

func HandleScrollDown

func HandleScrollDown(m *Model)

func HandleScrollInPrompt

func HandleScrollInPrompt(direction string, m *Model)

func HandleScrollUp

func HandleScrollUp(m *Model)

func HandleSelection

func HandleSelection(m *Model)

func HandleUpdate

func HandleUpdate(m *Model)

func KeybindingMap

func KeybindingMap(configuration config.Config) keyMap

func PromptStyle

func PromptStyle() lipgloss.Style

Types

type KeyBinding

type KeyBinding struct {
	Pane    string
	Binding key.Binding
	Action  KeyBindingAction
}

type KeyBindingAction

type KeyBindingAction struct {
	Action func(*Model) bool
	Name   string
}

type Model

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

Model represents the state of the UI.

func HandlePromptUpdate

func HandlePromptUpdate(m *Model, msg tea.KeyMsg) (*Model, tea.Cmd)

func NewModel

func NewModel() Model

NewModel create an instance of the entire application model.

func (*Model) GetState

func (m *Model) GetState() *state.State

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the UI and sets up initial data.

func (Model) MainDisplayPane

func (m Model) MainDisplayPane() string

func (Model) PromptContent

func (m Model) PromptContent() string

func (Model) PromptPane

func (m Model) PromptPane() string

func (*Model) SetCurrentUser

func (m *Model) SetCurrentUser(user api.User)

func (*Model) SetPromptSize

func (m *Model) SetPromptSize()

func (Model) ShouldRunAction

func (m Model) ShouldRunAction(pane string) bool

func (Model) ShowPane

func (m Model) ShowPane(pane string) bool

func (Model) Update

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

Update handles all UI interactions and events for updating the screen.

func (Model) View

func (m Model) View() string

type ViewSize

type ViewSize struct {
	Width  int
	Height int
}

Jump to

Keyboard shortcuts

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