Module media_card
Expand description
MediaCard and MediaGrid: albums, videos, books, photos, apps.
A media card is the art (a cover, a thumbnail, a photo) with its title and up to two meta lines under it. The art sits in the content with a seated edge and no shadow (only floating things cast one). Overlay badges over the art (a duration, watched progress, a live mark, a downloaded mark) use the floating material, the same as all chrome over media. Under the pointer the card lifts; keyboard focus rings the art in your colour, so the two never look the same.
Art that is not loaded yet, or does not exist, is generated: a smooth
neutral gradient with the initials of the title (or of the name an
art-only card is seeded with) sized from the tile, or the app’s icon for
an app. Art can also be a mosaic of covers (a playlist), the icon of a
kind of thing (a podcast, a folder), or painted by the app from theme
values. An artist is a circle (MediaAspect::Circle).
MediaGrid reflows cards into columns from the available width, with
every row’s text block as tall as its tallest so titles line up, or into
justified rows of photos at their own aspect ratios
(MediaGrid::justified, justified_rows).
Structs§
- Media
Card - A retained media card. See the module docs.
- Media
Card Face - Immediate-mode media card.
- Media
Grid - A responsive grid of
MediaCards. See the module docs.
Enums§
- Media
Art - What a card’s art is.
- Media
Aspect - The shape of a card’s art.
- Media
Badge - An overlay mark on the art.
- Media
Size - How large the cards of a grid are, in lines of body text so they grow with the text scale.
- Media
Source - Where a retained card’s art comes from.
- Owned
Badge - Owned badge for the retained card.
Functions§
- justified_
rows - Lay
aspects(width / height) out in justified rowswidthwide: each row is filled attarget_height, then scaled so it spans the width exactly. The last row keeps the target height instead of stretching, capped at the height of the row above it. Returns one rect per item, relative to the origin.
Type Aliases§
- ArtPainter
- Paints a card’s art into the rect it is given, from theme values.