styles

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TitleStyle = lipgloss.NewStyle().MarginLeft(2).BorderStyle(lipgloss.RoundedBorder()).
				BorderForeground(lipgloss.Color("#40C1AC")).Align(lipgloss.Left)
	ItemStyle         = lipgloss.NewStyle().PaddingLeft(4)
	SelectedItemStyle = lipgloss.NewStyle().PaddingLeft(2).Foreground(lipgloss.Color("170"))
	PaginationStyle   = list.DefaultStyles().PaginationStyle.PaddingLeft(4)
	HelpStyle         = list.DefaultStyles().HelpStyle.PaddingLeft(1).PaddingBottom(1).Faint(true).Align(lipgloss.Left)
	QuitTextStyle     = lipgloss.NewStyle().Margin(1, 0, 2, 4)
)
View Source
var (
	ViewPortTitleStyle = func() lipgloss.Style {
		b := lipgloss.RoundedBorder()
		b.Right = "├"
		return lipgloss.NewStyle().BorderStyle(b).Padding(0, 1)
	}()

	ViewPortInfoStyle = func() lipgloss.Style {
		b := lipgloss.RoundedBorder()
		b.Left = "┤"
		return ViewPortTitleStyle.BorderStyle(b)
	}()
)
View Source
var (
	AppStyle = lipgloss.NewStyle().Padding(1, 2)
)
View Source
var BaseStyle = lipgloss.NewStyle().
	BorderStyle(lipgloss.NormalBorder()).
	BorderForeground(lipgloss.Color("240"))
View Source
var (
	StatusMessageStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF94F4")).Bold(true).Render
)

Functions

func NewDefaultProfileStyles

func NewDefaultProfileStyles() (s types.DefaultItemStyles)

func NewDefaultShellStyles

func NewDefaultShellStyles() (s types.DefaultItemStyles)

func NewProfileDelegateKeyMap

func NewProfileDelegateKeyMap() (*profiledelegateKeyMap, error)

func NewShellDelegateKeyMap

func NewShellDelegateKeyMap() (*shelldelegateKeyMap, error)

Types

type ProfileItemDelegate

type ProfileItemDelegate struct {
	ShowDescription bool
	Styles          types.DefaultItemStyles
	UpdateFunc      func(msg tea.Msg, m *list.Model) tea.Cmd
	ShortHelpFunc   func() []key.Binding
	FullHelpFunc    func() [][]key.Binding
	// contains filtered or unexported fields
}

func NewProfileItemDelegate

func NewProfileItemDelegate(keys *profiledelegateKeyMap) (*ProfileItemDelegate, error)

func (ProfileItemDelegate) FullHelp

func (d ProfileItemDelegate) FullHelp() [][]key.Binding

FullHelp returns the delegate's full help.

func (ProfileItemDelegate) Height

func (pd ProfileItemDelegate) Height() int

func (ProfileItemDelegate) Render

func (d ProfileItemDelegate) Render(w io.Writer, m list.Model, index int, item list.Item)

func (*ProfileItemDelegate) SetHeight

func (pd *ProfileItemDelegate) SetHeight(i int)

func (*ProfileItemDelegate) SetSpacing

func (pd *ProfileItemDelegate) SetSpacing(i int)

SetSpacing sets the delegate's spacing.

func (ProfileItemDelegate) ShortHelp

func (d ProfileItemDelegate) ShortHelp() []key.Binding

ShortHelp returns the delegate's short help.

func (ProfileItemDelegate) Spacing

func (pd ProfileItemDelegate) Spacing() int

Spacing returns the delegate's spacing.

func (ProfileItemDelegate) Update

func (pd ProfileItemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

Update checks whether the delegate's UpdateFunc is set and calls it.

type ShellItemDelegate

type ShellItemDelegate struct {
	ShowDescription bool
	Styles          types.DefaultItemStyles
	UpdateFunc      func(msg tea.Msg, m *list.Model) tea.Cmd
	ShortHelpFunc   func() []key.Binding
	FullHelpFunc    func() [][]key.Binding
	// contains filtered or unexported fields
}

func NewShellItemDelegate

func NewShellItemDelegate(keys *shelldelegateKeyMap) (*ShellItemDelegate, error)

func (ShellItemDelegate) FullHelp

func (d ShellItemDelegate) FullHelp() [][]key.Binding

FullHelp returns the delegate's full help.

func (ShellItemDelegate) Height

func (pd ShellItemDelegate) Height() int

func (ShellItemDelegate) Render

func (d ShellItemDelegate) Render(w io.Writer, m list.Model, index int, item list.Item)

func (*ShellItemDelegate) SetHeight

func (pd *ShellItemDelegate) SetHeight(i int)

func (*ShellItemDelegate) SetSpacing

func (pd *ShellItemDelegate) SetSpacing(i int)

SetSpacing sets the delegate's spacing.

func (ShellItemDelegate) ShortHelp

func (d ShellItemDelegate) ShortHelp() []key.Binding

ShortHelp returns the delegate's short help.

func (ShellItemDelegate) Spacing

func (pd ShellItemDelegate) Spacing() int

Spacing returns the delegate's spacing.

func (ShellItemDelegate) Update

func (pd ShellItemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

Update checks whether the delegate's UpdateFunc is set and calls it.

type StatusBarUpdate

type StatusBarUpdate bool

Jump to

Keyboard shortcuts

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