ui

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultStylesheet = Stylesheet{
	SelectedPath: lipgloss.NewStyle().Foreground(lipgloss.Color("#74AC6D")),

	FinfoPermissions: lipgloss.NewStyle().Foreground(lipgloss.Color("#ACA46D")),
	FinfoLastUpdated: lipgloss.NewStyle().Foreground(lipgloss.Color("#E6E6E6")),
	FinfoSize:        lipgloss.NewStyle().Foreground(lipgloss.Color("#E6E6E6")),
	FinfoSep:         lipgloss.NewStyle().Foreground(lipgloss.Color("#2b2b2b")),

	OperationBar:      lipgloss.NewStyle().Foreground(lipgloss.Color("#E6E6E6")),
	OperationBarInput: lipgloss.NewStyle().Background(lipgloss.Color("#3C3C3C")),

	ErrBar:  lipgloss.NewStyle().Foreground(lipgloss.Color("#AC6D74")),
	HelpMsg: lipgloss.NewStyle().Foreground(lipgloss.Color("#ACA46D")),
	HelpContent: lipgloss.NewStyle().
		Foreground(lipgloss.Color("#8c7ca6")).
		BorderForeground(lipgloss.Color("#8c7ca6")).
		BorderStyle(lipgloss.NormalBorder()).
		BorderBottom(true).
		BorderLeft(true),

	TreeRegularFileName: lipgloss.NewStyle().Foreground(lipgloss.Color("#E6E6E6")),
	TreeDirecotryName:   lipgloss.NewStyle().Foreground(lipgloss.Color("#6D74AC")),
	TreeLinkName:        lipgloss.NewStyle().Foreground(lipgloss.Color("#6DACA4")),
	TreeMarkedNode: lipgloss.NewStyle().
		BorderLeft(true).
		BorderStyle(lipgloss.InnerHalfBlockBorder()).
		Background(lipgloss.Color("#363636")),
	TreeSelectionArrow: lipgloss.NewStyle().Foreground(lipgloss.Color("#ACA46D")),
	TreeIndent:         lipgloss.NewStyle().Foreground(lipgloss.Color("#363636")),
	TreeIndentSelected: lipgloss.NewStyle().Foreground(lipgloss.Color("#ACA46D")),

	PlainTextPreview: lipgloss.NewStyle().
		Italic(true).
		Foreground(lipgloss.Color("#a8a8a8")).
		BorderForeground(lipgloss.Color("#363636")).
		BorderStyle(lipgloss.NormalBorder()).
		BorderLeft(true),
}

Functions

func GeneratePreview added in v1.1.0

func GeneratePreview(node *t.Node, dim Dimentions, style Stylesheet) string

Types

type Dimentions added in v1.1.0

type Dimentions struct {
	Width  int
	Height int
}

type Preview added in v1.1.0

type Preview struct {
	Path    string
	Dim     Dimentions
	Content string
}

type Renderer

type Renderer struct {
	Style       Stylesheet
	EdgePadding int

	PreviewDoneChan <-chan Preview
	// contains filtered or unexported fields
}

func NewRenderer added in v1.1.0

func NewRenderer(
	style Stylesheet,
	edgePadding int,
	previewEnabled bool,
	highlightCurrentIndent bool,
) *Renderer

func (*Renderer) RemovePreviewCache added in v1.1.0

func (r *Renderer) RemovePreviewCache(path string)

func (*Renderer) Render

func (r *Renderer) Render(s *state.State, window Dimentions) string

func (*Renderer) SetPreviewCache added in v1.1.0

func (r *Renderer) SetPreviewCache(preivew Preview)

type Stylesheet

type Stylesheet struct {
	SelectedPath lipgloss.Style

	FinfoPermissions lipgloss.Style
	FinfoLastUpdated lipgloss.Style
	FinfoSize        lipgloss.Style
	FinfoSep         lipgloss.Style

	OperationBar      lipgloss.Style
	OperationBarInput lipgloss.Style

	ErrBar lipgloss.Style

	HelpMsg     lipgloss.Style
	HelpContent lipgloss.Style

	TreeRegularFileName lipgloss.Style
	TreeDirecotryName   lipgloss.Style
	TreeLinkName        lipgloss.Style
	TreeMarkedNode      lipgloss.Style
	TreeSelectionArrow  lipgloss.Style
	TreeIndent          lipgloss.Style
	TreeIndentSelected  lipgloss.Style

	PlainTextPreview lipgloss.Style
}

Jump to

Keyboard shortcuts

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