Cover grid

Square covers in even columns, each with a title and a line under it: albums, playlists, books. It is for choosing a thing by its picture and its name.

Part of the Music window on its Albums page: a header and a grid of album covers, the first with the mark for the album that is playing, each with the album's name and the artist under it, and a second row starting below.

Use it where each thing has a cover and a name, and people pick by either: an album and its artist, a playlist and its owner, a book and its author. This is the grid of Music's Albums page. Where the picture is the whole thing and has no words, such as a camera roll, use a picture grid. Where people look a thing up by its name, use a row list, and give an album's songs a row each.

How it differs from the picture grid

The two are siblings, not modes of one part. The cover grid sets one shape in columns and keeps words under every cover. The picture grid keeps each picture's own shape and sets none.

Picture gridCover grid
ShapeEach picture's ownOne square
LayoutRows filled to both edges, at a row heightColumns of covers about 180 across
WordsNone; a heading for each groupA title and a subtitle under every cover
Gap6 pixels24 pixels
SelectedSeveral, with Shift and CtrlOne, the one the keys act on
Used forPhotographs, screenshotsAlbums, playlists, books

Anatomy

Three covers in a row, the first with the mark for what is playing, the second selected. Numbered callouts above name a cover, the gap between covers and the selection; callouts at the sides name the mark, a title and a subtitle.
A row of three covers, with the words as the grid sets them.
  1. CoverThe picture, square, cropped to fit and rounded at the corners. A cover that has no picture, or cannot load it, shows a symbol (glyph) on the container colour.
  2. Gap24 pixels between covers, across and down.
  3. SelectionA wash of the main ink at 22 % over the cover. The cover keeps its size.
  4. MarkThe accent mark before the title of the cover that is in use (current), such as the album that is playing.
  5. TitleThe name, in the main ink, Medium. It shortens at its end.
  6. SubtitleWho it is by, or what it is, in the secondary ink. It shortens at its end.

The grid chooses the number of columns from its width and then widens the covers a little to fill the row, so a row never ends ragged. Only the rows on screen are made.

States

Every state is a wash on the cover, and the cover never changes its shape. The keyboard's ring is the one exception.

The same cover four times, numbered: at rest, under the pointer, selected, and selected with the keyboard focus ring.
  1. RestThe cover as it is.
  2. Pointer over itThe hover wash, 5 %.
  3. SelectedThe wash at 22 %.
  4. Keyboard focusThe ring, 4 pixels outside the cover, on the selected one.

A press also washes at 22 %. The pointer moves a wash over the cover but never the selection; a click selects. States gives the washes and the ring for every part.

Sizes

Two covers at their size, 180 by 180 with a 24-pixel gap between them, the title 12 pixels below the cover.
Two covers at their size.
PartValue
Cover180 across, aimed at (cover); the columns widen it to fill the row
Gap24 pixels, across and down (gap)
Cover corner12
Title12 pixels below the cover; the subtitle 4 below the title
RowThe cover, its two lines and a gap: the cover's width plus 48
Focus ring2 pixels wide, 4 pixels outside the cover, corner 16
Room for the ring6 pixels around the grid, kept inside its clip (ringRoom)
Default size900 by 600

Keys and pointer

The grid is one stop for Tab, as a row list is. Tab lands on the selected cover, or the first.

Do thisTo
← →Select the cover before or after
↑ ↓Select the cover in the row above or below
Home EndGo to the first or the last cover
EnterOpen
MenuThe cover's menu
ClickSelect
Double-clickOpen
Right-clickThe cover's menu; the cover is selected first

Unlike a list, the grid has no Shift or Ctrl selection, no Space and no type-to-jump.

Accessibility

Writing

The title is the thing's name as it is. The subtitle is one fact that tells two of the same name apart: the artist, the owner, the author. Put counts, years and lengths on the thing's own page. Both lines shorten at their end, so what matters comes first.

Do and don't

A cover with the album's name and its artist under it.
DoGive every cover its title and a subtitle. The words are how people tell covers that look alike apart.
A cover with an empty space under it where the words go.
Don'tUse the cover grid for pictures with no words. The grid keeps room for the words, so the pictures float apart: use a picture grid.
A cover with a short name and one artist under it.
DoKeep the subtitle to one fact.
A cover whose subtitle is the artist, the year, the number of songs and the length, cut off after the artist.
Don'tPile facts into the subtitle. It is cut at the end, and the grid is not the place for counts.

Code

import Tacit.Kit

CoverGrid {
    width: 900; height: 600
    label: "Albums"
    glyph: "music_note"
    items: library.albums.map(a => ({
        source: a.cover, title: a.name, subtitle: a.artist, current: a.key === player.albumKey }))
    onActivated: i => open(library.albums[i])
    onContextRequested: (i, at) => menu.openAt(this, at.x, at.y)
}
Property or signalWhat it does
itemsThe covers in order: source, title, subtitle, and current for the one in use
glyphThe symbol for a cover with no picture ("image" by default)
labelWhat a screen reader calls the grid
cursor, moveTo(index)The cover the keys act on (-1 for none), and a way to move it, scrolling it into view
cover, gap, columns, cell, countRead only: the aimed cover size (180), the gap (24), how many columns the width gives, the cell's width and how many covers there are
activated(index), contextRequested(index, at)Open, and ask for the cover's menu

Experimental, in Tacit.Kit 0.1. It selects one cover at a time.