gradientmap: multi-stop gradient editor widget

Summary

Adds a self-contained multi-stop gradient editor widget for the Gradient Map effect, replacing the previous single-color-pair controls. Users can now:

  • Add a stop by left-clicking anywhere on the gradient bar
  • Remove a stop by right-clicking it (minimum of 2 stops is always enforced)
  • Drag stops to reposition them, with automatic snapping to maintain a minimum distance between neighbors
  • Double-click a stop to open a color picker, including alpha
  • Add up to 32 stops per gradient

Stops are serialized into the MLT parameter as stop.N pairs (color + position), round-tripping cleanly through project save/load.

Visual details:

  • The gradient bar shows a light/dark checkerboard behind any translucent stop, so partial transparency is visible directly in the editor rather than only in the final render
  • The bar's border uses the active Qt/KDE widget style's native sunken frame, matching the look of other Kdenlive controls instead of a flat custom-drawn outline

Closes #1064 Also relates to #2206 (closed)

Testing

tests/gradienteditwidgettest.cpp ; 8 Catch2 test cases, 27 assertions, covering:

  • Default two-stop state
  • toString()/fromString() serialization round-trip
  • Adding a stop (including interpolated color at the new position)
  • Removing a stop
  • Minimum stop count enforcement (cannot drop below 2)
  • Maximum stop count enforcement (cannot exceed 32)
  • Minimum-distance snapping between adjacent stops
  • Project load round-trip, including alpha channel preservation

Manually verified in the running app:

  • Single clip with Gradient Map effect: add/remove/drag stops, verify preview updates live
  • Alpha checkerboard renders correctly behind translucent stops
  • Gradient bar frame matches native widget styling
  • Color dialog opens with alpha slider available and editable

Merge request reports

Loading