List row

One thing in a list: a file, a song, a contact. It says what kind of thing it is, its name, where it came from, and its facts, in one line 44 pixels high.

Part of a window with a list headed Today: a song, selected, a disc image, a document under the pointer and a picture, each with its size and time on the right.

Use it for anything people scan by name and pick from. Put rows in a row list, which owns the keyboard and the selection. For choices that change a setting, use a menu.

Anatomy

Five pieces, each in its own ink, and one optional sixth, the number before the name. Nothing else goes on the row: no second line, no badge, no symbol for an action.

A selected row between two rows of its list, enlarged, with numbered callouts on its symbol, name, the name beside it, its facts and its wash.
The row at 1.4 times its size, between two rows of its list.
  1. KindA symbol for what the thing is, or a small picture when it is a picture; a picture that fails to load falls back to its symbol. 20 pixels, in the secondary ink.
  2. NameThe name as it is. With no room, it shortens in the middle, so its end, often the type, stays.
  3. Beside the nameWhere it came from, or who made it, in the meta ink. It gives way first.
  4. FactsSize, time, length: right-aligned in fixed columns, with tabular figures so digits line up down the list.
  5. WashThe only sign of selection: the main ink at 10 % over the ground.

A row can also have a number before the name, such as a track's (lead), in the meta ink. Set leadFigures to the most figures any row's number has: the numbers then end in one column, and the name starts in the same place whether or not a row has one.

States

Every state is a wash of the main ink, so a row never changes its shape or its words. The keyboard ring is the one exception, and it shows only after a key. States gives the washes and the ring for every part; the row's are here.

The same row six times, numbered: at rest, under the pointer, pressed, selected, selected under the pointer, and with the keyboard focus ring.
  1. RestNo wash.
  2. Pointer over itThe hover wash, 5 %.
  3. Pressed22 %, while it is held.
  4. Selected10 %.
  5. Selected, pointer over it13 %, a step over the selection.
  6. Keyboard focusThe focus ring, around the row.

A quiet row (quiet), such as a cut file or a partial download, draws its symbol, name, name beside it and facts in the quiet ink. It never uses opacity, and the wash is the same.

Editing the name

editing turns the name into a line to type in, where the name is. The text does not move. A box 32 high, with the row's corner, the window's ground as its fill and a 2 pixel accent ring, holds it, and it grows with the text as far as the facts. The name beside it is hidden meanwhile; the kind and the facts stay.

A row between two rows of its list, twice. 1: a rename, the name without its type chosen in a box with an accent ring. 2: a new folder, all of Untitled folder chosen.
Rename, and a new item.
  1. RenameThe stem is chosen: the name up to its last dot, so "Budget 2027" of "Budget 2027.xlsx". A name with no dot is chosen whole, and so is any name when editAll is set.
  2. New itemThe app puts the row in the list, named "Untitled folder", with editAll and fresh set. Enter keeps the name as it stands, even unchanged.
Enter says `renamed(text)` when the text changed and is not empty, and `editCancelled()` when not. Esc says `editCancelled()`. The keyboard focus leaving the line says what Enter would. The app sets `editing` back to false when it hears either, and removes a new row it does not keep. The keyboard goes back to what had it. See [Asking](@asking).

Sizes

A row at one and a half times its size, selected, with a dimmed row above it: 16, 20 and 16 pixels before the name, a 64-pixel fact column, 44 high.
The row at 1.5 times its size.
PartValue
Height44
KindA 20-pixel symbol, 16 from the left; a picture 26 square, corner 6, on the same centre
NameStarts at 52; 15 pixels, regular (medium for the one in use), the main ink
Beside the name12 after the name; the meta ink
FactsColumns of 108 and 64 (factWidths), right-aligned, 16 from the right; the secondary ink
Corner8
Focus ring2 pixels, 2 outside the row; corner 12

Keys and pointer

In a row list, the list is one stop for Tab and the keyboard moves inside it.

Do thisTo
↑ ↓Move to the row above or below and select it
Shift with ↑ ↓Select from where you started to here
Ctrl with ↑ ↓, then Ctrl SpaceMove without selecting, then add or remove a row
Home End Page Up Page DownGo to the first, the last, or a screen up or down
Ctrl ASelect every row
F2Rename: the row list says editRequested, and the app sets editing
EnterOpen; while the name is edited, keep the name
SpaceTake a look without opening, for example in the app's docked panel
MenuThe row's menu
Type a nameGo to the first row whose name starts with what you typed
Click, Ctrl-click, Shift-clickSelect one, add or remove one, select a run
Double-clickOpen
Right-clickThe row's menu
Esc while editingGo back to the old name

Accessibility

Writing

Show names as they are: the file's own name, the song's title. Keep facts short: "11.6 MB", "18:02", "Tuesday". Today shows the time, this week the day, earlier the date.

Do and don't

A short list whose selected row is shown by its wash alone.
DoShow selection with the wash alone.
A short list whose selected row has a wash, a bar in the accent and heavier text.
Don'tAdd a bar or heavier words as well. Three signals for one state read as three states, and the accent bar means "you are here" in the rail.
A narrow list where a long file name stays whole and its source has gone.
DoLet the name beside the name shorten, then go, before the name itself.
A narrow list where a file name is cut while its source stays whole.
Don'tCut the file's name to keep where it came from. People find a file by its name.

Code

import Tacit.Kit

RowList {
    id: list
    model: files
    delegate: ListRow {
        required property var modelData
        required property int index
        width: list.rowWidth
        focusable: false                     // the list is the one tab stop
        glyph: modelData.kind                // "music_note", "picture_as_pdf"…
        name: modelData.name
        aside: modelData.from
        facts: [modelData.size, modelData.when]
        selected: list.isSelected(index)
        ring: list.ringAt(index)
        onClicked: m => list.clickAt(index, m)
        onActivated: list.activated(index)
    }
}
PropertyWhat it does
glyph or pictureThe kind: a Tacit symbol's name, or a picture's address
name, asideThe name, and the name beside it (the property is aside)
lead, leadFiguresA number before the name, and the room held for that many figures
quietA cut file or a partial download: the quiet ink
accessoryItems (a button, a mark) drawn just before the facts; the name gives them room
facts, factWidthsThe facts, right-aligned; their column widths (108 and 64)
selected, currentSelected (the wash); the one in use, its name in medium weight
editing, editAll, fresh, labelEdit the name in the row; choose all of it; a row just added (Enter keeps the name unchanged); what a screen reader calls the line ("Name")
ring, focusableSet by a row list: where the keyboard is, and that the list keeps the focus
clicked(modifiers), activated(), contextRequested(at)Select, open, and ask for the row's menu
renamed(text), editCancelled()The edit was kept with a new name; the edit ended with the name as it was

Experimental, in Tacit.Kit 0.1.