widgets

package
v0.0.0-...-5415481 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Draw

func Draw(texts []StyledText, screen tcell.Screen, styleSheet map[Class]tcell.Style) error

Types

type Alignment

type Alignment int
const (
	Left Alignment = iota
	Right
)

type Class

type Class int
const (
	// FIXME Maybe use string and names compatible with CSS?
	DefaultClass Class = iota
	TableHeader
	ActiveRow
)

type Mapping

type Mapping struct {
	From string
	To   string
}

FIXME Remove this. There is no need for custom column names.

type StatusBar

type StatusBar struct {
	InputBuffer string
	ShowInput   bool
	// contains filtered or unexported fields
}

func NewStatusBar

func NewStatusBar(width, height, bufferSize int) (StatusBar, error)

func (*StatusBar) Resize

func (s *StatusBar) Resize(width int, height int) error

func (StatusBar) Size

func (s StatusBar) Size() (int, int)

func (StatusBar) Text

func (s StatusBar) Text() ([]StyledText, error)

type StyledText

type StyledText struct {
	X       int
	Y       int
	Content string
	Class   Class
}

func Clear

func Clear(widget Widget, class Class) []StyledText

func (StyledText) Draw

func (t StyledText) Draw(screen tcell.Screen, styleSheet map[Class]tcell.Style) error

type Table

type Table struct {
	Source     cache.HierarchicalTabularDataSource
	ActiveLine int
	Columns    []string
	Rows       []cache.TabularSourceRow

	Sep string
	// contains filtered or unexported fields
}

func NewTable

func NewTable(source cache.HierarchicalTabularDataSource, columns []string, width int, height int, sep string) (Table, error)

func (*Table) Bottom

func (t *Table) Bottom() error

func (*Table) Refresh

func (t *Table) Refresh() error

func (*Table) Resize

func (t *Table) Resize(width int, height int) error

func (*Table) Scroll

func (t *Table) Scroll(amount int) error

func (*Table) SetFold

func (t *Table) SetFold(open bool, all bool) error

func (Table) Size

func (t Table) Size() (int, int)

func (*Table) Text

func (t *Table) Text() ([]StyledText, error)

func (*Table) Top

func (t *Table) Top() error

type Widget

type Widget interface {
	Resize(width int, height int) error
	Text() ([]StyledText, error)
	Size() (width int, height int)
}

Jump to

Keyboard shortcuts

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