Columns
ColumnDef
Each column is defined by a ColumnDef:
Creating columns
Column offsets
ColumnOffsets precomputes the left-edge x position of every column for
O(1) lookup during rendering and O(log n) hit-testing:
Offsets are automatically recomputed when columns change (resize, move, etc.).
Resizing
Drag the column separator to resize:
Auto-fit to content
Double-click the column separator to auto-fit:
The auto-fit scans all visible rows and the header to find the widest content, then sizes the column to fit.
Moving columns
Drag-and-drop to reorder columns:
This physically reorders the columns vector and recomputes offsets.
Column moves are recorded in the undo history.
Pinning columns
Pin leading columns so they stay visible during horizontal scroll:
Pinned columns are rendered on top of the scrolling area with a solid
background. The pinned width is model.pinned_width().