Public Functions
QLGradientEditor(std::vector<LString> stops, QWidget* parent = nullptr) | |
std::vector<LString> | stops() const |
Detailed Description
A QLGradientEditor is a QLWidget that provides the user with a way to edit colors of a gradient.
The editor is filled with the gradient being edited so that the user can see the result as they make changes.
QLColorControl widgets are spread out along the top of the editor, representing the individual colors that make up the gradient. The X-position of each control is proportional to the color's stop value. To change a color, the user can click on the corresponding control to launch a QLColorDialog for editing the color.
The X-position of each control, except the two on either end of the editor, can be moved by click-dragging. This is how a color's stop value can be changed. If there is already a control at the new X-position when the drag-control is released, then the control is deleted, and its color is removed from the gradient.
Between each color control, there is a QLButton with a plus icon which adds a color to the gradient. If two controls are visibly too close to each other, the button in-between them is hidden.