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 tags after it), an optional subtitle, then an optional secondary line of one or two linesBody (.strong() when emphasised), Body, Caption
factswhat the item is, in the same order on every row: when (a day and the time of day it is due), who (an avatar), how far (a progress count), how important (a mark); right-aligned on one edgeCaption.numeric(), Caption, icons
trailingone persistent control, a status dot, a check, a disclosure chevron—

Nothing stands inline after the title: a fact reads in the facts column, whose right edge is the same on every row of a list, so the facts of a list read as one column down its edge. What a face paints lives in paint beside this file; the rect of each of its columns in geometry.

Hover (or keyboard focus) swaps the facts column 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 rows sit edge to edge, with no rule between them.

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.
ControlRowProps
A selectable row of a short list whose items carry their own controls (a layers panel, each layer’s name beside its switches): a press none of its controls took chooses the row, and the chosen row is lifted off the ground it stands on.
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.
ListRowProps
A row of a list: what an item is, in one line, with the start of its content under it and a quiet fact on its trailing edge. Pressing it activates it: a list opens what it shows.
RowAction
One of a row’s hover actions: an icon button that names what it does.
RowChange
A change someone else made to what the row shows and the person has not seen yet (task-legibility §3): their face on the row’s trailing edge, their colour faintly under it, at the row’s own height.
RowShape
The geometry of a kind of list row. See the module docs.
ShownChange
The change a retained row shows, as ListRow::shown_change reads it: who made it, what they are called, what they did (the sentence under the title), and what assistive technology hears of it.
SwipeAction
The action a swipe reveals under the row’s trailing edge.
SwipeActionProps
What swiping a row across does: one command on its item, uncovered under the row as it moves.

Enums§

RowLeading
What sits in a row’s leading column.
RowLeadingShape
What leads a kind of row.
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§

CARD_TITLE_LINES
How many lines a card’s title may take before it is cut with an ellipsis: a card is a small document, and its title says what it is without being opened.
MAX_MARKS
How many marks ListRowFace::mark keeps on a row’s edge.

Traits§

CardBody
A widget that can be shown as a card: what a card component (a board’s BoardCard) asks of the one widget it was given, so the card is that widget’s own surface and what it says is written once. Asked as a capability, so a widget wrapped in a host’s pane, a context menu or any other decorator still answers.

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.