]> git.sesse.net Git - kdenlive/blobdiff - src/keyframeedit.cpp
Add a "full description" to effects. Will be shown when the parameter comments are...
[kdenlive] / src / keyframeedit.cpp
index 6085a27f554bae1da7c11b6e343b88fedf055a76..6dde054dafaea67c84e2bf2156120661865c3489 100644 (file)
@@ -100,23 +100,35 @@ void KeyframeEdit::addParameter(QDomElement e, int activeKeyframe)
 {
     keyframe_list->blockSignals(true);
     m_params.append(e.cloneNode().toElement());
-    QDomNode na = e.firstChildElement("name");
-    QString paramName = i18n(na.toElement().text().toUtf8().data());
+
+    QDomElement na = e.firstChildElement("name");
+    QString paramName = i18n(na.text().toUtf8().data());
+    QDomElement commentElem = e.firstChildElement("comment");
+    QString comment;
+    if (!commentElem.isNull())
+        comment = i18n(commentElem.text().toUtf8().data());
+
     int columnId = keyframe_list->columnCount();
     keyframe_list->insertColumn(columnId);
     keyframe_list->setHorizontalHeaderItem(columnId, new QTableWidgetItem(paramName));
 
     DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, 0,
             m_params.at(columnId).attribute("min").toInt(), m_params.at(columnId).attribute("max").toInt(),
-            m_params.at(columnId).attribute("default").toInt(), m_params.at(columnId).attribute("suffix"), this);
+            m_params.at(columnId).attribute("default").toInt(), comment, m_params.at(columnId).attribute("suffix"), this);
     connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframeValue(int)));
+    connect(this, SIGNAL(showComments()), doubleparam, SLOT(slotShowComment()));
     m_slidersLayout->addWidget(doubleparam, columnId, 0);
 
     QRadioButton *radio = new QRadioButton(this);
     m_showButtons->addButton(radio, columnId);
     if (e.attribute("intimeline") == "1")
         radio->setChecked(true);
-    m_slidersLayout->addWidget(radio, columnId, 1);
+
+    // make the radiobutton stay at the top
+    QVBoxLayout *radioLayout = new QVBoxLayout(this);
+    radioLayout->addWidget(radio);
+    radioLayout->addStretch();
+    m_slidersLayout->addLayout(radioLayout, columnId, 1);
 
     QStringList frames = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
     for (int i = 0; i < frames.count(); i++) {
@@ -161,7 +173,12 @@ void KeyframeEdit::slotDeleteKeyframe()
     keyframe_list->setCurrentCell(row, col);
     keyframe_list->selectRow(row);
     generateAllParams();
-    button_delete->setEnabled(keyframe_list->rowCount() > 1);
+
+    bool disable = keyframe_list->rowCount() < 2;
+    button_delete->setEnabled(!disable);
+    disable &= getPos(0) == m_min;
+    widgetTable->setHidden(disable);
+    buttonKeyframes->setHidden(!disable);
 }
 
 void KeyframeEdit::slotAddKeyframe()