layout

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FullScreen

func FullScreen(rm ResizingModel) tea.Model

FullScreen returns a model which will allocate the resizing model the entire height and width of the screen.

func Resize

func Resize(m tea.Model, w, h int) tea.Model

Resize sends a resize message to the passed in model. If m implements ResizingModel, then Resize is called; otherwise, m is returned without any messages.

Types

type BoxSize

type BoxSize interface {
	// contains filtered or unexported methods
}

func EqualSize

func EqualSize() BoxSize

func FirstChildFixedAt

func FirstChildFixedAt(size int) BoxSize

func LastChildFixedAt

func LastChildFixedAt(size int) BoxSize

type Compositor

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

func NewCompositor

func NewCompositor(background tea.Model) *Compositor

func (*Compositor) ClearOverlay

func (c *Compositor) ClearOverlay()

func (*Compositor) HasOverlay

func (c *Compositor) HasOverlay() bool

func (*Compositor) Init

func (c *Compositor) Init() tea.Cmd

func (*Compositor) MoveOverlay

func (c *Compositor) MoveOverlay(x, y int)

func (*Compositor) Resize

func (c *Compositor) Resize(w, h int) ResizingModel

func (*Compositor) SetOverlay

func (c *Compositor) SetOverlay(m ResizingModel, x, y, w, h int)

func (*Compositor) Update

func (c *Compositor) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Compositor) View

func (c *Compositor) View() string

type RequestLayout

type RequestLayout struct{}

type ResizableModelHandler

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

func NewResizableModelHandler

func NewResizableModelHandler(newModel func(w, h int) tea.Model) ResizableModelHandler

NewResizableModelHandler takes a tea model that requires a with and height during construction and has a resize method, and wraps it as a resizing model.

func (ResizableModelHandler) Init

func (rmh ResizableModelHandler) Init() tea.Cmd

func (ResizableModelHandler) Resize

func (rmh ResizableModelHandler) Resize(w, h int) ResizingModel

func (ResizableModelHandler) Update

func (rmh ResizableModelHandler) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ResizableModelHandler) View

func (rmh ResizableModelHandler) View() string

func (ResizableModelHandler) WithResize

func (rmh ResizableModelHandler) WithResize(resizeFn func(m tea.Model, w, h int) tea.Model) ResizableModelHandler

type ResizingModel

type ResizingModel interface {
	tea.Model
	Resize(w, h int) ResizingModel
}

ResizingModel is a model that handles resizing events. The submodel will not get WindowSizeMessages but will guarantee to receive at least one resize event before the initial view.

func Model

func Model(m tea.Model) ResizingModel

Model takes a tea-model and displays it as a resizing model. The model will be displayed with all the available space provided

type VBox

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

VBox is a model which will display its children vertically.

func NewVBox

func NewVBox(boxSize BoxSize, children ...ResizingModel) VBox

func (VBox) Init

func (vb VBox) Init() tea.Cmd

func (VBox) Resize

func (vb VBox) Resize(w, h int) ResizingModel

func (VBox) Update

func (vb VBox) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (VBox) View

func (vb VBox) View() string

type ZStack

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

func NewZStack

func NewZStack(visibleModel tea.Model, focusedModel tea.Model, otherModels ...tea.Model) ZStack

func (ZStack) Init

func (vb ZStack) Init() tea.Cmd

func (ZStack) Resize

func (vb ZStack) Resize(w, h int) ResizingModel

func (ZStack) Update

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

func (ZStack) View

func (vb ZStack) View() string

Jump to

Keyboard shortcuts

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