Documentation
¶
Overview ¶
Package layout provides tile-based layout management using teatile. It ensures consistent dimension handling between sidebar and content, preventing rendering glitches when content overflows.
Index ¶
- Constants
- type Layout
- func (l *Layout) ContentHeight() int
- func (l *Layout) ContentSize() (width, height int)
- func (l *Layout) ContentStyle(style lipgloss.Style) lipgloss.Style
- func (l *Layout) ContentWidth() int
- func (l *Layout) FooterSize() (width, height int)
- func (l *Layout) FooterStyle(style lipgloss.Style) lipgloss.Style
- func (l *Layout) HeaderSize() (width, height int)
- func (l *Layout) HeaderStyle(style lipgloss.Style) lipgloss.Style
- func (l *Layout) IsSidebarActive() bool
- func (l *Layout) MainSize() (width, height int)
- func (l *Layout) MainStyle(style lipgloss.Style) lipgloss.Style
- func (l *Layout) SetSidebarActive(active bool)
- func (l *Layout) SetSidebarWidth(width int)
- func (l *Layout) SetSize(width, height int)
- func (l *Layout) SidebarSize() (width, height int)
- func (l *Layout) SidebarStyle(style lipgloss.Style) lipgloss.Style
Constants ¶
const ( // HeaderHeight is the fixed height for the header tile HeaderHeight = 3 FooterHeight = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Layout ¶
type Layout struct {
// contains filtered or unexported fields
}
Layout manages the tile hierarchy for the application
func (*Layout) ContentHeight ¶
ContentHeight returns the height available for content (excluding header/footer)
func (*Layout) ContentSize ¶
ContentSize returns the content tile dimensions
func (*Layout) ContentStyle ¶
ContentStyle returns a lipgloss style with content dimensions applied
func (*Layout) ContentWidth ¶
ContentWidth returns the width available for main content When sidebar is inactive, returns full content width. When sidebar is active, returns content width minus sidebar width.
func (*Layout) FooterSize ¶
FooterSize returns the footer tile dimensions
func (*Layout) FooterStyle ¶
FooterStyle returns a lipgloss style with footer dimensions applied
func (*Layout) HeaderSize ¶
HeaderSize returns the header tile dimensions
func (*Layout) HeaderStyle ¶
HeaderStyle returns a lipgloss style with header dimensions applied
func (*Layout) IsSidebarActive ¶
IsSidebarActive returns whether the sidebar is currently visible
func (*Layout) SetSidebarActive ¶
SetSidebarActive controls whether the sidebar is visible
func (*Layout) SetSidebarWidth ¶
SetSidebarWidth sets the sidebar width (use 0 to hide)
func (*Layout) SidebarSize ¶
SidebarSize returns the sidebar tile dimensions