statusbar

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 3 Imported by: 4

Documentation

Overview

Package statusbar provides an statusbar bubble which can render four different status sections

Index

Constants

View Source
const Height = 1

Height represents the height of the statusbar.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorConfig

type ColorConfig struct {
	Foreground lipgloss.AdaptiveColor
	Background lipgloss.AdaptiveColor
}

ColorConfig

type Model

type Model struct {
	Width              int
	Height             int
	FirstColumn        string
	SecondColumn       string
	ThirdColumn        string
	FourthColumn       string
	FirstColumnColors  ColorConfig
	SecondColumnColors ColorConfig
	ThirdColumnColors  ColorConfig
	FourthColumnColors ColorConfig
}

Model represents the properties of the statusbar.

func New

func New(firstColumnColors, secondColumnColors, thirdColumnColors, fourthColumnColors ColorConfig) Model

New creates a new instance of the statusbar.

func (*Model) SetColors

func (m *Model) SetColors(firstColumnColors, secondColumnColors, thirdColumnColors, fourthColumnColors ColorConfig)

SetColors sets the colors of the 4 columns.

func (*Model) SetContent

func (m *Model) SetContent(firstColumn, secondColumn, thirdColumn, fourthColumn string)

SetContent sets the content of the statusbar.

func (*Model) SetSize

func (m *Model) SetSize(width int)

SetSize sets the width of the statusbar.

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

Update updates the size of the statusbar.

func (Model) View

func (m Model) View() string

View returns a string representation of a statusbar.

Jump to

Keyboard shortcuts

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