LoadCellDelegate

Paints one cell of a load list (monitor-load-color §MHD-8).

Declared in src/libs/libwidgets/components/visualization/LoadCellDelegate.hpp.

Detailed description

It reads a ResourceRowModel through its roles only, so a proxy between model and view sees every read. Per column:

  • The id: right-aligned, dim or in the row's id color, the pin glyph of the icon set before it on a pinned row.
  • The name: the life mark of RowLifecycle (§MHD-5) and its text.
  • The detail: the row's HeatStrip, on the time grid with the newest tick against the cell's right edge, or stretched over the cell without a grid; then the detail text over a shadow (StripText), as one gray text or as the row's colored tokens in order.
  • A number: the present load color (LoadColor), and black or white text by contrast on it (§MHD-4).

A pinned row is washed dark over every cell, over the load color of its numbers too, and the right-clicked row light; an ended row draws its text at RowLifecycle::kEndedTextOpacity, except the NAME of its mark. The list sets the Context, which the delegate keeps as a copy; a delegate with none draws a list with no menu open and the default background.

Two caches keep a paint cheap. Laid-out text is kept by its text, up to 8192 texts. A row's strip scaled to its cell is kept by the row's key until its strip, its columns or its size change. The list's view calls beginPaint() before each paint, which drops a strip that the paint before did not draw. So the cache holds the strips of the last two paints: at most twice the rows painted. A view that never calls beginPaint() holds at most 256 strips.

See also ResourceRowModel, HistoryStripListWidget, LoadColor.

In this section