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§
- File
Table - The file list a host keeps across its rebuilds.
- File
Table Inputs - What a rebuild puts into the list.
- File
Table Metrics - 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. - File
Table Outcome - What a host reads after forwarding an event to the list.
- Name
Cell - What a name cell shows: the entry’s glyph and its name.
- Shape
- Which optional columns the list is wide enough for.
Enums§
- File
Column - 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.