Fix incorrect initialization of Composite transition

when switching transition type from transition settings
Fix mouse wheel step for geometry size parameter
parent 54554d17
......@@ -54,7 +54,7 @@ DragValue::DragValue(const QString &label, double defaultValue, int decimals, do
setFocusPolicy(Qt::StrongFocus);
setContextMenuPolicy(Qt::CustomContextMenu);
setFocusPolicy(Qt::StrongFocus);
QHBoxLayout *l = new QHBoxLayout;
l->setSpacing(0);
l->setContentsMargins(0, 0, 0, 0);
......
......@@ -207,6 +207,7 @@ GeometryWidget::GeometryWidget(EffectMetaInfo *info, int clipPos, bool showRotat
//m_ui.horizontalLayout->addStretch(10);
m_spinSize = new DragValue(i18n("Size"), 100, 2, 1, 99000, -1, i18n("%"), false, this);
m_spinSize->setStep(10);
m_ui.horizontalLayout2->addWidget(m_spinSize);
m_opacity = new DragValue(i18n("Opacity"), 100, 0, 0, 100, -1, i18n("%"), true, this);
......
......@@ -22,6 +22,7 @@
#include "kdenlivesettings.h"
#include "mainwindow.h"
#include "timeline/transition.h"
#include "timeline/transitionhandler.h"
#include "effectslist/effectslist.h"
#include "effectstack/effectstackedit.h"
#include "project/projectmanager.h"
......@@ -159,6 +160,7 @@ void TransitionSettings::slotTransitionChanged(bool reinit, bool updateCurrent)
// Reset the transition parameters to the default one
disconnect(m_effectEdit->monitor(), SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
QDomElement newTransition = MainWindow::transitions.getEffectByName(transitionList->currentText()).cloneNode().toElement();
pCore->projectManager()->currentTimeline()->transitionHandler->initTransition(newTransition);
slotUpdateEffectParams(e, newTransition);
m_effectEdit->transferParamDesc(newTransition, m_usedTransition->info(), false);
if (m_effectEdit->needsMonitorEffectScene())
......
......@@ -63,6 +63,16 @@ bool TransitionHandler::addTransition(QString tag, int a_track, int b_track, Gen
return true;
}
void TransitionHandler::initTransition(QDomElement xml)
{
QMap<QString, QString> params = getTransitionParamsFromXml(xml);
QMapIterator<QString, QString> i(params);
while (i.hasNext()) {
i.next();
EffectsList::setParameter(xml, i.key(),i.value());
}
}
QMap<QString, QString> TransitionHandler::getTransitionParamsFromXml(const QDomElement &xml)
{
QDomNodeList attribs = xml.elementsByTagName(QStringLiteral("parameter"));
......
......@@ -37,6 +37,7 @@ class TransitionHandler : public QObject
public:
explicit TransitionHandler(Mlt::Tractor *tractor);
bool addTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml);
/** @brief Initialize transition settings if necessary and return an array of values. */
QMap<QString, QString> getTransitionParamsFromXml(const QDomElement &xml);
void plantTransition(Mlt::Transition &tr, int a_track, int b_track);
void plantTransition(Mlt::Field *field, Mlt::Transition &tr, int a_track, int b_track);
......@@ -58,6 +59,8 @@ public:
void rebuildTransitions(int mode, QList <int> videoTracks, int maxTrack);
/** @brief Returns the matching composite transition depending on the current settings. */
static const QString compositeTransition();
/** @brief Initialize transition settings. */
void initTransition(QDomElement xml);
private:
Mlt::Tractor *m_tractor;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment