Documentation
¶
Index ¶
- Constants
- Variables
- func EntryIcon(e *structure.Entry) string
- func NewProgressBar(width int, full, empty rune) progress.Model
- func NewStatusBar(items []*BarItem, totalWidth int) string
- func SetTeaProgram(tp *tea.Program)
- type BarItem
- type ChangeLevelHandler
- type Column
- type DirModel
- type DriveModel
- type Mode
- type Navigation
- func (n *Navigation) DrivesList() *drive.List
- func (n *Navigation) Entry() *structure.Entry
- func (n *Navigation) Explore(path string) error
- func (n *Navigation) LevelDown(path string, cursor int, clh ChangeLevelHandler) (chan struct{}, chan error)
- func (n *Navigation) LevelUp(clh ChangeLevelHandler)
- func (n *Navigation) Lock() bool
- func (n *Navigation) Locked() bool
- func (n *Navigation) ParentSize() int64
- func (n *Navigation) State() State
- func (n *Navigation) Unlock()
- type SortState
- type State
- type ViewModel
Constants ¶
const ( DefaultBorder = '\ue0b0' DefaultBarBGColor = "#353533" DynamicWidth = -1 )
Variables ¶
Functions ¶
func EntryIcon ¶
EntryIcon resolves an emoji icon for the provided Entry instance based on the file extension.
func NewStatusBar ¶
NewStatusBar builds a new status bar based on the provided list of *BarItem instances. The total bar width is defined by the totalWidth parameter and all bar items will be fit in that width according to their parameters or evenly spread for the available width.
NOTE: This implementation does not guarantee that the manually defined element sizes will not exceed the totalWidth value.
func SetTeaProgram ¶
Types ¶
type BarItem ¶
type BarItem struct {
// contains filtered or unexported fields
}
BarItem represents a single status bar item, including its string content, background color, and width. The width parameter is optional, and the default width equals the content width.
The width value -1 denotes that the item will take all available screen width minus the sum of all other elements' widths. If multiple items have a width value of -1, the resulting width will be spread equally between them.
func DefaultBarItem ¶
DefaultBarItem returns a new *BarItem instance with default values for background color and width.
func NewBarItem ¶
NewBarItem returns a new *BarItem instance based on the provided parameters. If the background color is an empty string, a default color will be assigned.
type ChangeLevelHandler ¶
type DirModel ¶
type DirModel struct {
// contains filtered or unexported fields
}
func NewDirModel ¶
func NewDirModel(nav *Navigation) *DirModel
type DriveModel ¶
type DriveModel struct {
// contains filtered or unexported fields
}
func NewDriveModel ¶
func NewDriveModel(n *Navigation) *DriveModel
func (*DriveModel) Init ¶
func (dm *DriveModel) Init() tea.Cmd
func (*DriveModel) View ¶
func (dm *DriveModel) View() string
type Navigation ¶
type Navigation struct {
// contains filtered or unexported fields
}
func NewNavigation ¶
func NewNavigation(l *drive.List, t *structure.Tree) *Navigation
func (*Navigation) DrivesList ¶
func (n *Navigation) DrivesList() *drive.List
func (*Navigation) Entry ¶
func (n *Navigation) Entry() *structure.Entry
func (*Navigation) Explore ¶
func (n *Navigation) Explore(path string) error
func (*Navigation) LevelDown ¶
func (n *Navigation) LevelDown(path string, cursor int, clh ChangeLevelHandler) (chan struct{}, chan error)
func (*Navigation) LevelUp ¶
func (n *Navigation) LevelUp(clh ChangeLevelHandler)
func (*Navigation) Lock ¶
func (n *Navigation) Lock() bool
func (*Navigation) Locked ¶
func (n *Navigation) Locked() bool
func (*Navigation) ParentSize ¶
func (n *Navigation) ParentSize() int64
func (*Navigation) State ¶
func (n *Navigation) State() State
func (*Navigation) Unlock ¶
func (n *Navigation) Unlock()
type ViewModel ¶
type ViewModel struct {
// contains filtered or unexported fields
}
func NewViewModel ¶
func NewViewModel(n *Navigation) *ViewModel