tui

package
v0.1.43 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CompressingSpinner = spinner.Globe
View Source
var Keys = KeyMap{
	Quit: key.NewBinding(
		key.WithKeys("q", "ctrl+q"),
	),
	Down: key.NewBinding(
		key.WithKeys("down"),
	),
	Up: key.NewBinding(
		key.WithKeys("up"),
	),
	Left: key.NewBinding(
		key.WithKeys("left"),
	),
	Right: key.NewBinding(
		key.WithKeys("right"),
	),
	Enter: key.NewBinding(
		key.WithKeys("enter"),
	),
	Escape: key.NewBinding(
		key.WithKeys("esc"),
	),
	View: key.NewBinding(
		key.WithKeys("V"),
	),
	GotoBottom: key.NewBinding(
		key.WithKeys("G"),
	),
	HomeShortcut: key.NewBinding(
		key.WithKeys("~"),
	),
	RootShortcut: key.NewBinding(
		key.WithKeys("/"),
	),
	ToggleHidden: key.NewBinding(
		key.WithKeys("."),
	),
	ShowDirectoriesOnly: key.NewBinding(
		key.WithKeys("D"),
	),
	ShowFilesOnly: key.NewBinding(
		key.WithKeys("F"),
	),
	Edit: key.NewBinding(
		key.WithKeys("E"),
	),
	Find: key.NewBinding(
		key.WithKeys("ctrl+f"),
	),
	ToggleBox: key.NewBinding(
		key.WithKeys("tab"),
	),
	Receive: key.NewBinding(
		key.WithKeys("ctrl+r"),
	),
	Send: key.NewBinding(
		key.WithKeys("ctrl+s"),
	),
}

DefaultKeyMap returns a set of default keybindings.

View Source
var ReceivingSpinner = spinner.Spinner{
	Frames: []string{"   ", "  «", " ««", "«««"},
	FPS:    time.Second / 2,
}
View Source
var TransferSpinner = spinner.Spinner{
	Frames: []string{"»  ", "»» ", "»»»", "   "},
	FPS:    time.Millisecond * 400,
}
View Source
var WaitingSpinner = spinner.Dot

Functions

func GracefulUIQuit

func GracefulUIQuit()

func HandleReceiveCommand

func HandleReceiveCommand(programOptions models.TranOptions, password string)

HandleReceiveCommand is the receive application.

func HandleSendCommand

func HandleSendCommand(programOptions models.TranOptions, fileNames []string)

func NewReceiverUI

func NewReceiverUI() *tea.Program

func NewSenderUI

func NewSenderUI() *tea.Program

func TopLevelFilesText

func TopLevelFilesText(fileNames []string) string

func ValidateTranxAddress

func ValidateTranxAddress() error

Types

type Bubble

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

Bubble represents the state of the UI.

func New

func New() Bubble

New creates an instance of the entire application.

func (Bubble) Init

func (b Bubble) Init() tea.Cmd

Init initializes the UI and sets up initial data.

func (Bubble) Update

func (b Bubble) Update(msg tea.Msg) (tea.Model, tea.Cmd)

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

func (Bubble) View

func (b Bubble) View() string

View returns a string representation of the entire application UI.

type ErrorMsg

type ErrorMsg struct {
	Message string
}

type FileInfoMsg

type FileInfoMsg struct {
	FileNames []string
	Bytes     int64
}

type FinishedMsg

type FinishedMsg struct {
	Files       []string
	PayloadSize int64
}

type KeyMap

type KeyMap struct {
	Quit                key.Binding
	Down                key.Binding
	Up                  key.Binding
	Left                key.Binding
	Right               key.Binding
	View                key.Binding
	Receive             key.Binding
	GotoBottom          key.Binding
	HomeShortcut        key.Binding
	RootShortcut        key.Binding
	ToggleHidden        key.Binding
	ShowDirectoriesOnly key.Binding
	ShowFilesOnly       key.Binding
	Enter               key.Binding
	Edit                key.Binding
	Find                key.Binding
	Send                key.Binding
	Command             key.Binding
	Escape              key.Binding
	ToggleBox           key.Binding
}

type PasswordMsg

type PasswordMsg struct {
	Password string
}

type ProgressMsg

type ProgressMsg struct {
	Progress float32
}

type ReadyMsg

type ReadyMsg struct{}

type UIUpdate

type UIUpdate struct {
	Progress float32
}

Jump to

Keyboard shortcuts

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