xnano.core.controller
xnano.core.controller
¶
xnano.core.controller
Paint grids through their complete layout pipeline.
Classes:
-
TerminalController–Collect absolute paint requests for one native frame.
TerminalController
¶
TerminalController(runtime: Any)
Collect absolute paint requests for one native frame.
Methods:
-
paint_clear–Blank
areaatzso an overlay occludes the content below it. -
align_slot_content–Return the sub-area a field's content paints into.
Source code in xnano/core/controller.py
paint_clear
¶
Blank area at z so an overlay occludes the content below it.
ratatui styles a bordered block's interior but leaves the glyphs under it intact; a popup must clear first to read as opaque.
Source code in xnano/core/controller.py
align_slot_content
¶
Return the sub-area a field's content paints into.
Vertical alignment has no ratatui equivalent — Paragraph only
aligns horizontally — so a non-"top" vertical_align is
resolved here by offsetting the slot's origin. Nested grids are
excluded: they fill their slot and have no intrinsic height.
Source code in xnano/core/controller.py
wrapped_line_count
¶
Return how many rows text occupies when wrapped at width.
ratatui wraps on word boundaries, so a raw splitlines() count is
short for any line longer than its slot. textwrap matches that
behavior closely enough to place content; it is not a substitute for
ratatui's own measurement.
ponytail: approximates unicode width as one cell per character. Bind
ratatui's Paragraph::line_count if wide glyphs need exact rows.
Source code in xnano/core/controller.py
content_scroll_extent
¶
Measure a scroll field's total content extent along axis.
Rows for the "y" axis, columns for "x". Falls back to a
component's declared size when the value is not row-oriented text.
Source code in xnano/core/controller.py
window_scroll_value
¶
Return value windowed by offset cells along axis.
Drops the leading offset rows/columns of plain-string content so the
fixed-height slot (which clips the bottom natively) shows the window.
Non-text values are returned unchanged.