Skip to main content

Module file_table

Module file_table 

Expand description

The file list: a folder’s entries as the toolkit’s DataTable, with a Name, a Size and a Modified column. It is the one list of files on the desktop: the file manager’s folder view and the system file chooser both show it, so a folder reads, sorts, selects and scrolls the same wherever a person meets it.

The table paints the header, the rows, the selection lift, the sort indicator, the numeric columns and the scrollbar, and owns scrolling, column resizing, keyboard movement, touch and the accessibility rows. The file list adds what makes it a list of files:

  • the columns, which shrink and then drop out on a narrow list (the name always keeps its room) and follow the text scale and the host’s zoom;
  • the name cell, which a row paints itself (FileRow::paint_name): by default the file’s icon and its name, and in the file manager its preview, its sync emblem and an in-place rename;
  • the rows’ rectangles, read back from the table’s accessibility export, so a host can resolve a press, a drag or a drop to the row the table laid out.

A FileTable lives across its host’s rebuilds, so its scroll position, its column widths and its scroll anchor survive them. Everything a rebuild changes (rows, selection, sort, zoom) goes in through FileTable::sync.

Structs§

FileTable
The file list a host keeps across its rebuilds.
FileTableInputs
What a rebuild puts into the list.
FileTableMetrics
The file list’s measures, from the theme’s tokens, scaled by the host’s zoom (scale). Every host of the list lays it out with these, so a folder’s rows and columns are the same size everywhere.
FileTableOutcome
What a host reads after forwarding an event to the list.
NameCell
What a name cell shows: the entry’s glyph and its name.
Shape
Which optional columns the list is wide enough for.

Enums§

FileColumn
The column a list is sorted by, which its header marks.
Modified
How much of a file’s modified time its column shows.

Traits§

FileRow
One row of a file list: a file or a folder.

Functions§

paint_icon_and_name
Paint a name cell: its icon, then its name elided to the cell, as in every file list. Returns where the name ends, for a row that adds something after it.