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 tags after it), an optional subtitle, then an optional secondary line of one or two lines | Body (.strong() when emphasised), Body, Caption |
| facts | what 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 edge | Caption.numeric(), Caption, icons |
| trailing | one 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§
- 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. - Control
RowProps - 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).
- 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. - List
RowProps - 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.
- Shown
Change - The change a retained row shows, as
ListRow::shown_changereads it: who made it, what they are called, what they did (the sentence under the title), and what assistive technology hears of it. - Swipe
Action - The action a swipe reveals under the row’s trailing edge.
- Swipe
Action Props - 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.
- RowLeading
Shape - 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::markkeeps on a row’s edge.
Traits§
- Card
Body - 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’sListRowFace::leading_column. ASectiondoes this for the retained rows it holds.