tree

package
v0.0.0-...-9e1763a Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNode

func NewNode(parentPath string, file fs.FileInfo) *tview.TreeNode

func NewRootNode

func NewRootNode(path string) *tview.TreeNode

Types

type ContentView

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

func NewContentView

func NewContentView(theme *Theme) *ContentView

func (*ContentView) Blur

func (ft *ContentView) Blur()

func (*ContentView) Draw

func (ft *ContentView) Draw(screen tcell.Screen)

func (*ContentView) Focus

func (ft *ContentView) Focus(delegate func(p tview.Primitive))

func (*ContentView) GetRect

func (ft *ContentView) GetRect() (int, int, int, int)

func (*ContentView) HasFocus

func (ft *ContentView) HasFocus() bool

func (*ContentView) InputHandler

func (ft *ContentView) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*ContentView) MouseHandler

func (ft *ContentView) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

func (*ContentView) SetPreview

func (v *ContentView) SetPreview(fsnode *FSNode)

func (*ContentView) SetRect

func (ft *ContentView) SetRect(x, y, width, height int)

type FSNode

type FSNode struct {
	Name     string
	Path     string
	IsDir    bool
	Size     int64
	Node     *tview.TreeNode
	Mode     fs.FileMode
	ModTime  time.Time
	MimeType string
}

func (*FSNode) Collapse

func (n *FSNode) Collapse()

func (*FSNode) CreateParent

func (n *FSNode) CreateParent() *FSNode

func (*FSNode) Expand

func (n *FSNode) Expand()

func (*FSNode) IsExpanded

func (n *FSNode) IsExpanded() bool

func (*FSNode) ReadChildren

func (n *FSNode) ReadChildren()

func (*FSNode) Title

func (n *FSNode) Title() string

type FileTree

type FileTree struct {
	AfterDraw []func()
	// contains filtered or unexported fields
}

func NewFileTree

func NewFileTree(theme *Theme) *FileTree

func (*FileTree) Blur

func (ft *FileTree) Blur()

func (*FileTree) Draw

func (ft *FileTree) Draw(screen tcell.Screen)

func (*FileTree) Focus

func (ft *FileTree) Focus(delegate func(p tview.Primitive))

func (*FileTree) GetParent

func (ft *FileTree) GetParent(fsnode *FSNode) *FSNode

func (*FileTree) GetRect

func (ft *FileTree) GetRect() (int, int, int, int)

func (*FileTree) HasFocus

func (ft *FileTree) HasFocus() bool

func (*FileTree) InputHandler

func (ft *FileTree) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*FileTree) IsRoot

func (ft *FileTree) IsRoot(fsnode *FSNode) bool

func (*FileTree) Load

func (ft *FileTree) Load(dir string)

func (*FileTree) MouseHandler

func (ft *FileTree) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

func (*FileTree) OnChanged

func (ft *FileTree) OnChanged(fn func(node *FSNode))

func (*FileTree) OnOpen

func (ft *FileTree) OnOpen(fn func(node *FSNode))

func (*FileTree) OnSelect

func (ft *FileTree) OnSelect(fn func(node *FSNode))

func (*FileTree) SetCurrent

func (ft *FileTree) SetCurrent(fsnode *FSNode)

func (*FileTree) SetRect

func (ft *FileTree) SetRect(x, y, width, height int)

func (*FileTree) SetRoot

func (ft *FileTree) SetRoot(fsnode *FSNode)

type Theme

type Theme struct {
	SidebarBackground tcell.Color
	SidebarLines      tcell.Color
	ContentBackground tcell.Color
	Border            tcell.Color
	TopbarBorder      tcell.Color
}

func GetTheme

func GetTheme() *Theme

Jump to

Keyboard shortcuts

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