layout

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layout

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

Layout represents our base TUI layout with header, viewport, and footer

func New

func New() *Layout

New creates a new Layout with default styles

func (*Layout) GetViewportHeight

func (l *Layout) GetViewportHeight() int

GetViewportHeight returns the current height of the viewport

func (*Layout) GetViewportWidth

func (l *Layout) GetViewportWidth() int

GetViewportWidth returns the current width of the viewport

func (*Layout) GetViewportYPosition

func (l *Layout) GetViewportYPosition() int

GetViewportYPosition gets the current vertical scroll position

func (*Layout) HalfPageDown

func (l *Layout) HalfPageDown()

HalfPageDown scrolls the viewport down half a page

func (*Layout) HalfPageUp

func (l *Layout) HalfPageUp()

HalfPageUp scrolls the viewport up half a page

func (*Layout) Init

func (l *Layout) Init() tea.Cmd

Init initializes the layout model

func (*Layout) LineDown

func (l *Layout) LineDown()

LineDown scrolls the viewport down one line

func (*Layout) LineUp

func (l *Layout) LineUp()

LineUp scrolls the viewport up one line

func (*Layout) PageDown

func (l *Layout) PageDown()

PageDown scrolls the viewport down a full page

func (*Layout) PageUp

func (l *Layout) PageUp()

PageUp scrolls the viewport up a full page

func (*Layout) ScrollToBottom

func (l *Layout) ScrollToBottom()

ScrollToBottom scrolls to the bottom of the viewport

func (*Layout) ScrollToTop

func (l *Layout) ScrollToTop()

ScrollToTop scrolls to the top of the viewport

func (*Layout) SetContent

func (l *Layout) SetContent(content string)

SetContent sets the viewport content

func (*Layout) SetFooter

func (l *Layout) SetFooter(footer string)

SetFooter sets the footer content

func (*Layout) SetFooterHeight

func (l *Layout) SetFooterHeight(height int)

SetFooterHeight sets the footer height

func (*Layout) SetFooterStyle

func (l *Layout) SetFooterStyle(style lipgloss.Style)

SetFooterStyle sets the footer style

func (*Layout) SetHeader

func (l *Layout) SetHeader(header string)

SetHeader sets the header content

func (*Layout) SetHeaderHeight

func (l *Layout) SetHeaderHeight(height int)

SetHeaderHeight sets the header height

func (*Layout) SetHeaderStyle

func (l *Layout) SetHeaderStyle(style lipgloss.Style)

SetHeaderStyle sets the header style

func (*Layout) SetViewportYPosition

func (l *Layout) SetViewportYPosition(y int)

SetViewportYPosition sets the vertical scroll position of the viewport

func (*Layout) Update

func (l *Layout) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles events and updates the layout state

func (*Layout) View

func (l *Layout) View() string

View renders the layout

func (*Layout) ViewportAtBottom

func (l *Layout) ViewportAtBottom() bool

ViewportAtBottom returns whether the viewport is scrolled to the bottom

func (*Layout) ViewportAtTop

func (l *Layout) ViewportAtTop() bool

ViewportAtTop returns whether the viewport is scrolled to the top

Jump to

Keyboard shortcuts

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