#include "doubleparameterwidget.h"
#include "cornerswidget.h"
#include "beziercurve/beziersplinewidget.h"
-#include "beziercurve/cubicbezierspline.h"
#include <KDebug>
#include <KLocale>
KisCurveWidget *curve = (KisCurveWidget*)m_valueItems[name];
if (curve) {
int color = value.toInt();
- curve->setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(curve->size(), (ColorTools::ColorsRGB)color, 0.8)));
+ curve->setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(curve->size(), (ColorTools::ColorsRGB)(color == 3 ? 4 : color), 0.8)));
+ }
+ } else if (type == "bezier_spline") {
+ BezierSplineWidget *widget = (BezierSplineWidget*)m_valueItems[name];
+ if (widget) {
+ widget->setMode((BezierSplineWidget::CurveModes)((int)(value.toDouble() * 10)));
}
}
}
bool disable = d.attribute("disable") == "1" && KdenliveSettings::disable_effect_parameters();
setEnabled(!disable);
+ bool stretch = true;
+
for (int i = 0; i < namenode.count() ; i++) {
QDomElement pa = namenode.item(i).toElement();
if (!depends.isEmpty())
meetDependency(paramName, type, EffectsList::parameter(e, depends));
} else if (type == "bezier_spline") {
- BezierSplineWidget *widget = new BezierSplineWidget(this);
- CubicBezierSpline spline;
- spline.fromString(value);
- widget->setSpline(spline);
+ BezierSplineWidget *widget = new BezierSplineWidget(value, this);
+ stretch = false;
m_vbox->addWidget(widget);
m_valueItems[paramName] = widget;
connect(widget, SIGNAL(modified()), this, SLOT(collectAllParameters()));
+ QString depends = pa.attribute("depends");
+ if (!depends.isEmpty())
+ meetDependency(paramName, type, EffectsList::parameter(e, depends));
} else if (type == "corners") {
CornersWidget *corners = new CornersWidget(m_monitor, pos, isEffect, pa.attribute("factor").toInt(), this);
connect(corners, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
if (toFillin)
m_vbox->addWidget(toFillin);
}
- m_vbox->addStretch();
+
+ if (stretch)
+ m_vbox->addStretch();
if (m_keyframeEditor)
m_keyframeEditor->checkVisibleParam();
meetDependency(paramName, type, EffectsList::parameter(newparam, depends));
} else if (type == "bezier_spline") {
BezierSplineWidget *widget = (BezierSplineWidget*)m_valueItems.value(paramName);
- setValue = widget->spline().toString();
+ setValue = widget->spline();
+ QString depends = pa.attributes().namedItem("depends").nodeValue();
+ if (!depends.isEmpty())
+ meetDependency(paramName, type, EffectsList::parameter(newparam, depends));
} else if (type == "corners") {
CornersWidget *corners = ((CornersWidget*)m_valueItems.value(paramName));
QString xName = pa.attributes().namedItem("xpoints").nodeValue();