Row

termflow.tui.Layout.Row
final case class Row(gap: Int, children: List[Layout])

Horizontal flow: children are placed left-to-right, top-aligned, with gap empty cells between siblings.

Value parameters

children

Layout items in render order (first = leftmost).

gap

Number of cells between adjacent children. Negative values are treated as 0.

Attributes

Members list

Value members

Inherited methods

def measure: (Int, Int)

Natural (width, height) of this layout, in cells.

Natural (width, height) of this layout, in cells.

Attributes

Inherited from:
Layout
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def resolve(at: Coord): List[VNode]

Resolve this layout into a flat list of absolute-positioned VNodes starting at at.

Resolve this layout into a flat list of absolute-positioned VNodes starting at at.

The returned list is in render order. Callers typically pass it as the children argument of a RootNode; use toRootNode for a slightly more concise variant.

Attributes

Inherited from:
Layout
def toBudgetedRootNode(width: Int, height: Int, input: Option[InputNode]): RootNode

Wrap this layout in a RootNode with layout = Some(this), so the renderer resolves it at render time against the frame's full (width, height) budget.

Wrap this layout in a RootNode with layout = Some(this), so the renderer resolves it at render time against the frame's full (width, height) budget.

Prefer this form for full-screen apps and any layout containing Layout.Fill / Layout.Grid / Layout.Border: the resolved positions update with the terminal size, and Fill regions actually fill the available space instead of collapsing.

Equivalent to:

RootNode(width, height, Nil, input, layout = Some(this))

Value parameters

height

Frame height — the resolver's available height budget.

input

Optional focused input to attach to the root.

width

Frame width — the resolver's available width budget.

Attributes

Inherited from:
Layout
def toRootNode(width: Int, height: Int, input: Option[InputNode], at: Coord): RootNode

Eagerly resolve this layout at at and wrap the resulting positioned vnodes in a RootNode.children list.

Eagerly resolve this layout at at and wrap the resulting positioned vnodes in a RootNode.children list.

'''Caveat — no size budget.''' This form calls Layout.resolve, which uses each layout's natural size and ignores the width / height arguments for sizing. As a result:

  • Layout.Fill regions collapse to their natural (zero) size.
  • The frame does not reflow when the terminal resizes — children are baked at the resolution time.

Use this form for fixed-size sub-regions, dialogs, panels you have already sized by hand, and golden-snapshot tests where you want deterministic positions.

For full-screen / resizable apps that want Fill and reflow, use toBudgetedRootNode instead — it puts the layout into RootNode.layout so the renderer resolves it against the actual frame size at render time.

Value parameters

at

Origin for the layout resolver. Defaults to (1, 1).

height

Terminal height to advertise on the root.

input

Optional focused input to attach to the root.

width

Terminal width to advertise on the root.

Attributes

Inherited from:
Layout