Skip to main content

Crate makeover_tui

Crate makeover_tui 

Source
Expand description

The terminal renderer for makeover_layout.

§Surfaces

frame draws a region at a Depth. It paints the depth’s fill where Palette::shows says the fill differs from what is behind it, draws the bevel around the outside, and returns the Rect left for content: one cell in from each side an edge took. A fill begins and ends on a cell boundary, and a frame has no corner radius.

Above sixteen colours the bevel is drawn in half-blocks, and the two corners where its tones meet carry both, one per half-cell. At Fidelity::Ansi16 and Fidelity::NoColor it is drawn in box-drawing characters: doubled for Depth::Raised, light for every other depth.

§Overlays, selection and the focus ring

Palette::fill answers Fill::Overlay, so Depth::Overlay is painted from a description with no edge. Theme::selection_on and Theme::focus_ring are derived from the theme’s other tokens, so the theme format has no key for either; border-strong is a divider.

§Modules

  • table draws a described table through ratatui::widgets::Table, measuring content and narrowing columns.
  • text wraps styled runs in terminal cells.
  • piece draws the renderer-local pieces; its docs say which of the vocabulary’s members the host draws instead.
  • theme (feature theme) loads a makeover theme into a Palette quantised for a Fidelity.

§Every colour is in the palette

Palette holds the surfaces and bevel pair a frame needs and the Tones text and tables are drawn in. The styles hold metrics and marks only. A tone the palette leaves empty is said with a modifier instead.

§No substitution

Palette::fill returns None for an intent it has no colour for, and frame then draws the edge alone. Fill::Well does not fall back to Fill::Page.

Re-exports§

pub use makeover_layout;

Modules§

piece
The pieces every terminal app draws, drawn once: the ink every terminal drawing resolves once per frame (Ink), a badge or chip (token), and the wait marks (activity and awaiting, out of wiki loading-and-progress-standard).
table
Column layout and row structure for tables.
text
Words into cells.

Structs§

Palette
The resolved colours this renderer needs.
Tones
The colours text, controls and tables are drawn in.

Enums§

Fidelity
How many colours the terminal can show, as the caller recorded it.
MotionPreference
Whether the reader asked for less motion, as activity_lit takes it. Whether the reader has asked for less motion, as their platform reported it.

Functions§

activity_lit
Whether the activity mark is lit, elapsed into a wait: the phase of makeover_timing::blink. With motion reduced it is always lit.
frame
Draw a region at a given Depth and return the area left for content.
paint_bevel
Paint a two-tone edge around the outside of area.