Skip to main content

Module list_row

Module list_row 

Expand description

ListRow: one row of a content list (a message, a contact, a request, a file, a device), as a retained widget and as the ListRowFace immediate painter with identical geometry.

A row has up to four columns, each optional except the title:

ColumnHoldsSet in
leadingan Avatar, an Icon, a short badge (GET), a thumbnail, a checkbox, a swatch, in a fixed-width column so a list’s titles line upthe leading slot’s own geometry
textthe title (with a mark and tags after it), an optional subtitle, then an optional secondary line of one or two linesBody (.strong() when emphasised), Body, Caption
metaa timestamp, a size, a count, on the title’s lineCaption.numeric(), right-aligned
trailinga value, one persistent control, a status dot, a check, a disclosure chevron—

Hover (or keyboard focus) swaps the meta for the row’s actions. The row height comes from the measured line boxes of its text, never a constant, so it grows with the text scale. Selection is the lift (HIG §9.3), and the inset separator between two rows hides beside a selected row.

One content edge. The row’s text starts on its column’s content edge; the hover and selection lift bleed row_bleed past it on both sides. A face paints into the row’s outer rect (the content edge grown by the bleed); a retained row grows its own layout box by the bleed when it paints, so its title lines up with the section title above it.

Structs§

ControlRow
A selectable row of a short list whose items carry real controls (a layers panel with each layer’s thumbnail, name and switches; a list of versions with a restore button): a crate::widget::Row of widgets standing in the list row’s selection lift.
ListRow
A retained list row. Construct with a stable id and a title; press activates it (pointer, Enter/Space, or assistive technology).
ListRowFace
Immediate-mode list row. Build one per row per frame, measure it for its height, then paint it into the rect you laid out: the row’s outer rect, the list’s content edge grown by row_bleed on both sides.
RowAction
One of a row’s hover actions: an icon button that names what it does.
SwipeAction
The action a swipe reveals under the row’s trailing edge.

Enums§

RowLeading
What sits in a row’s leading column.
RowStatus
A status dot on the row’s trailing edge, on the title’s line; beside a check or a disclosure chevron it centres with them.
RowValue
How prominent a row’s trailing value is.

Constants§

MAX_MARKS
How many marks ListRowFace::mark keeps after a title.

Functions§

badge_column_width
Measure the leading column that fits every badge in badges, so a list of rows with badges of different lengths keeps one title edge. Pass the result to every row’s ListRowFace::leading_column. A Section does this for the retained rows it holds.