#[non_exhaustive]pub enum RowPart {
Primary,
Secondary,
Meta,
Actions,
Tokens,
}Expand description
The parts of a list row.
Four to begin with, taken from Balanced Breakfast, which was the only
consumer that had all of them (row-primary, row-secondary, row-meta,
row-actions). audiofiles has two and no slot structure at all, so it gains
meta and actions as real work rather than a rename; goingson moves off
task-row / task-cell.
Tokens joined at 0.9.0, and #[non_exhaustive] with it.
See the crate header for why the two arrived together.
§Meta against Tokens
The line is whether the thing has its own standing. Meta is one short
trailing fact about the row, written as text: a count, a size, a date.
Tokens is a set of small labelled things, each of which can be toned and
can answer a click. “3 files” is meta. A status badge that is amber, and a
tag you can click to filter by, are tokens.
Keeping them apart is what a single widened slot would have foreclosed. A renderer can right-align one string and cannot usefully do the same to a strip of chips, and a fact that is not clickable should not be drawn as though it were.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Primary
The thing itself. What the row is called.
Secondary
Supporting text under the primary.
Meta
A short trailing fact: a count, a size, a date.
Actions
Controls that act on this row.
Tokens
Small labelled things belonging to the row: badges, chips, tags.
Each carries its own Token kind and Tone, so a renderer with no
colour still has the kind to work with, and one with no chips still has
the label. That is the constrained-consumer test this vocabulary exists
to pass, and it is why the tone lives on the token rather than on the
part.
Implementations§
Source§impl RowPart
impl RowPart
Sourcepub const fn revealed_on_hover(self) -> bool
pub const fn revealed_on_hover(self) -> bool
Whether the part stays hidden until the row is hovered or focused.
Behaviour of the part, not app policy: Balanced Breakfast and goingson grew the same hover-reveal on their actions independently and neither applies it to anything else.
A renderer with no hover shows it always. That is a renderer decision
and this returning true does not forbid it.