components

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checkbox

func Checkbox(label string, checked *bool, onFocus func(), onBlur func()) *tview.Checkbox

func CloseFilter

func CloseFilter(filter *tview.InputField)

func CloseModal

func CloseModal()

func CreateButton

func CreateButton(label string) *tview.Button

func CreateFilter

func CreateFilter() *tview.InputField

func CreateOutputView

func CreateOutputView(title string) (*tview.TextView, *misc.ThreadSafeWriter)

func CreateSearch

func CreateSearch() *tview.InputField

func CreateText

func CreateText(title string) *tview.TextView

func CreateTextArea

func CreateTextArea(title string) *tview.TextArea

func EmptySearch

func EmptySearch()

func InitFilter

func InitFilter(filter *tview.InputField, text string)

func IsModalOpen

func IsModalOpen() bool

func OpenModal

func OpenModal(pageTitle string, title string, contentPane *tview.Flex, width int, height int)

Used for when a custom tview Flex is passed to a modal.

func OpenTextModal

func OpenTextModal(pageTitle string, text_color string, text_no_color string, title string)

Used for when text is passed to a modal.

func SearchInList

func SearchInList(list *tview.List, query string, lastFoundIndex *int, direction int)

func SearchInTable

func SearchInTable(table *tview.Table, query string, lastFoundRow, lastFoundCol *int, direction int)

func SearchInTree

func SearchInTree(tree *TTree, query string, lastFoundIndex *int, direction int)

func SetActiveButtonStyle

func SetActiveButtonStyle(button *tview.Button)

func SetInactiveButtonStyle

func SetInactiveButtonStyle(button *tview.Button)

func ShowFilter

func ShowFilter(filter *tview.InputField, text string)

func ShowSearch

func ShowSearch()

Types

type TList

type TList struct {
	Root   *tview.Flex
	List   *tview.List
	Filter *tview.InputField

	Title       string
	FilterValue *string

	IsItemSelected   func(item string) bool
	ToggleSelectItem func(i int, itemName string)
	SelectAll        func()
	UnselectAll      func()
	FilterItems      func()
}

func (*TList) ClearFilter

func (l *TList) ClearFilter()

func (*TList) Create

func (l *TList) Create()

func (*TList) SetItemSelect

func (l *TList) SetItemSelect(i int, item string)

func (*TList) Update

func (l *TList) Update(items []string)

type TNode

type TNode struct {
	ID          string // The reference
	DisplayName string // What is shown
	Type        string

	TreeNode *tview.TreeNode
	Children *[]TNode
}

type TTable

type TTable struct {
	Root   *tview.Flex
	Table  *tview.Table
	Filter *tview.InputField

	Title         string
	FilterValue   *string
	ShowHeaders   bool
	ToggleEnabled bool

	IsRowSelected   func(name string) bool
	ToggleSelectRow func(name string)
	SelectAll       func()
	UnselectAll     func()
	FilterRows      func()
	DescribeRow     func(name string)
	EditRow         func(name string)
}

func (*TTable) ClearFilter

func (t *TTable) ClearFilter()

func (*TTable) Create

func (t *TTable) Create()

func (*TTable) CreateTableHeader

func (t *TTable) CreateTableHeader(header string) *tview.TableCell

func (*TTable) SetRowSelect

func (t *TTable) SetRowSelect(row int)

func (*TTable) ToggleSelectCurrentRow

func (t *TTable) ToggleSelectCurrentRow(name string)

func (*TTable) Update

func (t *TTable) Update(headers []string, rows [][]string)

func (*TTable) UpdateRowStyle

func (t *TTable) UpdateRowStyle()

type TToggleText

type TToggleText struct {
	Value    *string
	Option1  string
	Option2  string
	Label1   string
	Label2   string
	Data1    string
	Data2    string
	TextView *tview.TextView
}

func (*TToggleText) Create

func (t *TToggleText) Create()

type TTree

type TTree struct {
	Tree     *tview.TreeView
	Root     *tview.Flex
	RootNode *tview.TreeNode
	Filter   *tview.InputField

	List          []*TNode
	Title         string
	RootTitle     string
	FilterValue   *string
	SelectEnabled bool

	IsNodeSelected   func(name string) bool
	ToggleSelectNode func(name string)
	SelectAll        func()
	UnselectAll      func()
	FilterNodes      func()
	DescribeNode     func(name string)
	EditNode         func(name string)
}

func (*TTree) BuildProjectTree

func (t *TTree) BuildProjectTree(node *tview.TreeNode, tnode dao.TreeNode)

func (*TTree) ClearFilter

func (t *TTree) ClearFilter()

func (*TTree) Create

func (t *TTree) Create()

func (*TTree) FocusFirst

func (t *TTree) FocusFirst()

func (*TTree) FocusLast

func (t *TTree) FocusLast()

func (*TTree) ToggleSelectCurrentNode

func (t *TTree) ToggleSelectCurrentNode(id string)

func (*TTree) UpdateProjects

func (t *TTree) UpdateProjects(paths []dao.TNode)

func (*TTree) UpdateProjectsStyle

func (t *TTree) UpdateProjectsStyle()

func (*TTree) UpdateTasks

func (t *TTree) UpdateTasks(nodes []TNode)

func (*TTree) UpdateTasksStyle

func (t *TTree) UpdateTasksStyle()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳