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:
| Column | Holds | Set in |
|---|---|---|
| leading | an Avatar, an Icon, a short badge (GET), a thumbnail, a checkbox, a swatch, in a fixed-width column so a list’s titles line up | the leading slot’s own geometry |
| text | the title (with a mark and tags after it), an optional subtitle, then an optional secondary line of one or two lines | Body (.strong() when emphasised), Body, Caption |
| meta | a timestamp, a size, a count, on the title’s line | Caption.numeric(), right-aligned |
| trailing | a 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§
- Control
Row - 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::Rowof 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).
- List
RowFace - Immediate-mode list row. Build one per row per frame,
measureit for its height, thenpaintit into the rect you laid out: the row’s outer rect, the list’s content edge grown byrow_bleedon both sides. - RowAction
- One of a row’s hover actions: an icon button that names what it does.
- Swipe
Action - 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::markkeeps 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’sListRowFace::leading_column. ASectiondoes this for the retained rows it holds.