GradientTrackWidget
A gradient's ramp with a draggable dot per stop, as a view over a GradientStopModel — rendering-revamp §RVG-2.
| Inherits | QWidget |
Declared in src/libs/libwidgets/components/GradientTrackWidget.hpp.
Detailed description
The track draws, hit-tests, drags, adds and removes. It never edits a color: the editor that holds it picks a color for the selected stop and writes it to the model. So the same track serves libpaint's spectral gradients and the material editor's RGBA gradients.
A click on the ramp adds a stop there, with the color the gradient has there. A drag moves a stop between its neighbors. Delete or Backspace, or an Alt-click, removes the selected stop. The two end stops stay at 0 and 1. The selection is a QItemSelectionModel over the model, so it follows its row when another row is added or removed.