tui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLine added in v0.4.0

func CreateLine(
	wordList list.List,
	numberOfSpaces int,
	leftoverSpaces int) string

func RenderProfile added in v0.2.0

func RenderProfile(
	profile *mastodon.Account,
	width int,
	showImages bool) (string, error)

func RenderStatus added in v0.4.0

func RenderStatus(
	status *mastodon.Status,
	toot *mast.Toot,
	width int,
	showImages bool,
	justifyText bool,
	isReblog bool,
) (string, error)

func RenderTimeline

func RenderTimeline(
	timeline *mast.Timeline,
	width int,
	showImages bool,
	justifyText bool) (string, error)

func RenderToot

func RenderToot(
	toot *mast.Toot,
	width int,
	showImages bool,
	justifyText bool) (string, error)

func StringPtr added in v0.4.0

func StringPtr(s string) *string

func TUI

func TUI(tuiCore TUICore)

func WrapWithIndent added in v0.4.0

func WrapWithIndent(
	stringToWrap string,
	maximumWidth int,
	indentString string,
	justifyText bool,
) string

Types

type ModeType

type ModeType int
const (
	NormalMode  ModeType = 1
	CommandMode          = 2
)

type ProgressManager added in v0.4.0

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

func NewProgress added in v0.4.0

func NewProgress(field *tview.InputField, app *tview.Application) *ProgressManager

func (*ProgressManager) Run added in v0.4.0

func (i *ProgressManager) Run(action func() (mast.CmdReturnCode, bool))

func (*ProgressManager) SetLabel added in v0.4.0

func (i *ProgressManager) SetLabel(label string)

type TUICore

type TUICore struct {
	Client  *mastodon.Client
	App     *tview.Application
	CmdLine *tview.InputField
	Profile *tview.TextView
	Stream  *tview.TextView
	Grid    *tview.Grid

	Prompt string
	Mode   ModeType

	Timeline             mast.Timeline
	RenderedTimelineType mast.TimelineType

	Options  TUIOptions
	Progress *ProgressManager
	Help     string
}

func (*TUICore) EnterCommandMode

func (tuiCore *TUICore) EnterCommandMode() bool

func (*TUICore) ExitCommandMode

func (tuiCore *TUICore) ExitCommandMode(force bool) bool

func (*TUICore) ShowHelp

func (tuiCore *TUICore) ShowHelp()

func (*TUICore) UpdateTimeline

func (tuiCore *TUICore) UpdateTimeline(scrollToEnd bool) bool

type TUIOptions

type TUIOptions struct {
	ShowImages     bool
	AutoCompletion bool
	JustifyText    bool
}

Jump to

Keyboard shortcuts

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