panes

package
v0.0.0-...-1a0b77f Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlignmentVerticalTop    AlignmentVertical = "top"
	AlignmentVerticalCenter AlignmentVertical = "center"
	AlignmentVerticalBottom AlignmentVertical = "bottom"

	AlignmentHorizontalLeft   AlignmentHorizontal = "left"
	AlignmentHorizontalCenter AlignmentHorizontal = "center"
	AlignmentHorizontalRight  AlignmentHorizontal = "right"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlignmentHorizontal

type AlignmentHorizontal string

func ToAlignmentHorizontal

func ToAlignmentHorizontal(raw string) (AlignmentHorizontal, error)

type AlignmentVertical

type AlignmentVertical string

func ToAlignmentVertical

func ToAlignmentVertical(raw string) (AlignmentVertical, error)

type Direction

type Direction int
const (
	DirectionVertical Direction = iota
	DirectionHorizontal
)

type Pane

type Pane struct {
	// contains filtered or unexported fields
}

func NewLeaf

func NewLeaf(m tea.Model) Pane

NewModel creates a new pane containing the given model.

func NewNode

func NewNode(direction Direction, children ...Pane) Pane

NewNode creates a new pane containing the given children.

func (Pane) Children

func (m Pane) Children() []Pane

func (Pane) Height

func (m Pane) Height() int

func (Pane) Init

func (m Pane) Init() tea.Cmd

func (Pane) Update

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

func (Pane) View

func (m Pane) View() string

func (Pane) Width

func (m Pane) Width() int

func (Pane) WithAlignment

func (m Pane) WithAlignment(vertical AlignmentVertical, horizontal AlignmentHorizontal) Pane

func (Pane) WithDimensions

func (m Pane) WithDimensions(width, height int) (Pane, tea.Cmd)

func (Pane) WithDirection

func (m Pane) WithDirection(direction Direction) Pane

func (Pane) WithName

func (p Pane) WithName(name string) Pane

type ViewableSizeMsg

type ViewableSizeMsg struct {
	Width  int
	Height int
}

Jump to

Keyboard shortcuts

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