statusbar

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color struct {
	Background string
	Foreground string
}

Color is a struct that contains the foreground and background colors of the statusbar.

type Model

type Model struct {
	Width                int
	Height               int
	LabelColumnContent   string
	LabelColumnColors    Color
	CommandColumnContent string
	CommandColumnColors  Color
	ShowCommandBar       bool
	TextInput            textinput.Model
}

Model is a struct that contains all the properties of the statusbar.

func NewModel

func NewModel(firstColumnColors, secondColumnColors Color) Model

NewModel creates an instance of a statusbar.

func (*Model) BlurCommandBar

func (m *Model) BlurCommandBar()

BlurCommandBar blurs the textinput used for the command bar.

func (Model) CommandBarFocused

func (m Model) CommandBarFocused() bool

func (Model) CommandBarValue

func (m Model) CommandBarValue() string

func (*Model) FocusCommandBar

func (m *Model) FocusCommandBar()

func (Model) GetContent

func (m Model) GetContent() (string, string)

func (*Model) ResetCommandBar

func (m *Model) ResetCommandBar()

ResetCommandBar resets the textinput used for the command bar.

func (*Model) SetContent

func (m *Model) SetContent(firstColumnContent, secondColumnContent string)

SetContent sets the content of the statusbar.

func (*Model) SetSelectedPane

func (m *Model) SetSelectedPane(pane string)

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize sets the size of the statusbar, useful when the terminal is resized.

func (Model) Update

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

Update updates the statusbar.

func (*Model) UpdateByPane

func (m *Model) UpdateByPane(filter string)

func (Model) View

func (m Model) View() string

View returns a string representation of the statusbar.

Jump to

Keyboard shortcuts

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