Documentation
¶
Index ¶
- type Box
- func (b Box) Center(w, h int) Box
- func (b Box) CutBottom(h int) (rest, bottom Box)
- func (b Box) CutLeft(w int) (left, rest Box)
- func (b Box) CutRight(w int) (rest, right Box)
- func (b Box) CutTop(h int) (top, rest Box)
- func (b Box) H(specs ...Spec) []Box
- func (b Box) Inset(n int) Box
- func (b Box) V(specs ...Spec) []Box
- type FillSpec
- type Fixed
- type Percent
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Box ¶ added in v0.9.11
Box wraps a cellbuf.Rectangle to provide a fluent API for layout calculations. It enables declarative layout syntax instead of manual rectangle arithmetic.
func (Box) Center ¶ added in v0.9.11
Center returns a box of size w×h centered within this box. If the requested size is larger than available space, it's clamped.
func (Box) CutBottom ¶ added in v0.9.11
CutBottom cuts h cells from the bottom, returning the rest and the bottom box.
func (Box) CutLeft ¶ added in v0.9.11
CutLeft cuts w cells from the left, returning the left box and the rest.
func (Box) CutRight ¶ added in v0.9.11
CutRight cuts w cells from the right, returning the rest and the right box.
func (Box) CutTop ¶ added in v0.9.11
CutTop cuts h cells from the top, returning the top box and the rest.
func (Box) H ¶ added in v0.9.11
H splits the box horizontally (left to right) according to the given specs. Returns a slice of boxes, one for each spec.
type FillSpec ¶ added in v0.9.11
type FillSpec float64
FillSpec allocates space proportionally from remaining space after fixed/pct allocations. The weight determines the proportion: Fill(2) gets twice the space of Fill(1).