Module card
Expand description
Card and CardGrid: objects in content.
A card exists only for an object: something the person can open, move,
share or drag (an app in a store, a document, a review comment, a saved
connection). Settings groups, form sections and statistics are not cards;
they sit on the content ground separated by space (Section,
FormSection, StatTile).
A card has a header (its name in Subheading, with one optional trailing
action), a body, and an optional footer of Actions. Its height is its
content’s; in a CardGrid a row is as tall as its tallest card and the
footers line up. A card that opens something is itself pressable
(Card::on_activate) and lifts under the pointer. A leading stripe in a
Tone marks whose or what kind of object it is (a reviewer’s comment, a
failed job).
CardFace paints the same surface, stripe, title and focus ring for a
caller that lays out and paints its own body.
Structs§
- Actions
- Standard actions in declaration/focus order: secondaries, then primary. Unspecified buttons use measured content sizing; explicit sizes remain manual. Each wrapped line aligns to the trailing edge.
- Card
- A retained card. See the module docs.
- Card
Face - Immediate-mode card: the surface, leading stripe, title and focus ring
of a
Card, for a caller that paints its own body intoCardFace::body_rect. - Card
Grid - Reflows its cards into equal, aligned columns by width. Each row is as tall as its tallest card; cards share the row’s height so their footers line up, and a row of short cards stays short.
Enums§
- Card
Width - How wide a grid’s cards are at least, before the grid drops a column. Measured in lines of body text, so cards widen with the text scale.
Functions§
- card_
column_ width - The width of each of
colscolumns that, withgapbetween them, fillavail_wexactly. Never negative. - card_
columns - How many columns of at least
min_card_wfit inavail_wwithgapbetween them. Always at least 1.