Documentation
¶
Overview ¶
Package layout provides terminal layout management for memtui. It calculates pane sizes for the 2-pane layout (KeyList + Viewer).
Index ¶
- Constants
- type Bounds
- type Layout
- func (l *Layout) Calculate()
- func (l *Layout) ContentHeight() int
- func (l *Layout) ContentY() int
- func (l *Layout) HeaderBounds() Bounds
- func (l *Layout) HeaderHeight() int
- func (l *Layout) Height() int
- func (l *Layout) IsValid() bool
- func (l *Layout) KeyListBounds() Bounds
- func (l *Layout) KeyListWidth() int
- func (l *Layout) KeyListX() int
- func (l *Layout) SetKeyListRatio(ratio float64)
- func (l *Layout) SetSize(width, height int)
- func (l *Layout) StatusBarBounds() Bounds
- func (l *Layout) StatusBarHeight() int
- func (l *Layout) String() string
- func (l *Layout) ViewerBounds() Bounds
- func (l *Layout) ViewerWidth() int
- func (l *Layout) ViewerX() int
- func (l *Layout) Width() int
Constants ¶
const ( // MinKeyListWidth is the minimum width for the key list pane MinKeyListWidth = 10 // MinViewerWidth is the minimum width for the viewer pane MinViewerWidth = 20 // DefaultKeyListRatio is the default width ratio for the key list (30%) DefaultKeyListRatio = 0.30 // HeaderLines is the number of lines used by the header HeaderLines = 2 // StatusBarLines is the number of lines used by the status bar StatusBarLines = 1 // BorderWidth is the width of the border between panes BorderWidth = 1 )
Constants for layout constraints
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bounds ¶
Bounds represents a rectangular area in the terminal
type Layout ¶
type Layout struct {
// contains filtered or unexported fields
}
Layout manages the terminal layout for memtui
func (*Layout) Calculate ¶
func (l *Layout) Calculate()
Calculate computes all layout dimensions based on current terminal size
func (*Layout) ContentHeight ¶
ContentHeight returns the height of the content area
func (*Layout) HeaderBounds ¶
HeaderBounds returns the bounds of the header area
func (*Layout) HeaderHeight ¶
HeaderHeight returns the height of the header
func (*Layout) KeyListBounds ¶
KeyListBounds returns the full bounds of the key list pane
func (*Layout) KeyListWidth ¶
KeyListWidth returns the width of the key list pane
func (*Layout) SetKeyListRatio ¶
SetKeyListRatio sets the ratio of width for the key list pane Value should be between 0.1 and 0.9
func (*Layout) StatusBarBounds ¶
StatusBarBounds returns the bounds of the status bar
func (*Layout) StatusBarHeight ¶
StatusBarHeight returns the height of the status bar
func (*Layout) ViewerBounds ¶
ViewerBounds returns the full bounds of the viewer pane
func (*Layout) ViewerWidth ¶
ViewerWidth returns the width of the viewer pane