]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackview.cpp
on-monitor editing: show controls next to the edit monitor
[kdenlive] / src / effectstackview.cpp
index 1c2fe12ce9a8f75a7c1afbfe524c2dd76ea47ac5..944e2841a12937f6057ee2aebf20b2ab8544902f 100644 (file)
@@ -23,6 +23,7 @@
 #include "docclipbase.h"
 #include "projectlist.h"
 #include "kthumb.h"
+#include "monitoreditwidget.h"
 #include "monitorscene.h"
 #include "kdenlivesettings.h"
 
@@ -294,8 +295,7 @@ void EffectStackView::setupListView(int ix)
         m_ui.buttonShowComments->setEnabled(false);
         m_ui.labelComment->setHidden(true);
     } else {
-        qMin(ix, 0);
-        qMax(ix, m_ui.effectlist->count() - 1);
+        ix = qBound(0, ix, m_ui.effectlist->count() - 1);
         m_ui.effectlist->setCurrentRow(ix);
         m_ui.checkAll->setEnabled(true);
     }
@@ -313,8 +313,9 @@ void EffectStackView::slotItemSelectionChanged(bool update)
     int activeRow = m_ui.effectlist->currentRow();
     bool isChecked = false;
     if (hasItem && m_ui.effectlist->currentItem()->checkState() == Qt::Checked) isChecked = true;
+    QDomElement eff;
     if (hasItem && m_ui.effectlist->currentItem()->isSelected()) {
-        QDomElement eff = m_currentEffectList.at(activeRow);
+        eff = m_currentEffectList.at(activeRow);
         if (m_trackMode) {
             // showing track effects
             m_effectedit->transferParamDesc(eff, 0, 0, m_trackInfo.duration);
@@ -335,7 +336,7 @@ void EffectStackView::slotItemSelectionChanged(bool update)
     m_ui.buttonShowComments->setEnabled(hasItem);
 
     emit showComments(m_ui.buttonShowComments->isChecked());
-    m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || !m_ui.labelComment->text().count() || !hasItem);
+    m_ui.labelComment->setVisible(hasItem && m_ui.labelComment->text().count() && (m_ui.buttonShowComments->isChecked() || !eff.elementsByTagName("parameter").count()));
 }
 
 void EffectStackView::slotItemUp()
@@ -484,7 +485,7 @@ void EffectStackView::slotCheckAll(int state)
 void EffectStackView::slotCheckMonitorPosition(int renderPos)
 {
     if (m_trackMode || (renderPos >= m_clipref->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_clipref->endPos().frames(KdenliveSettings::project_fps()))) {
-        if (!m_monitor->getEffectScene()->views().at(0)->isVisible())
+        if (!m_monitor->getEffectEdit()->getScene()->views().at(0)->isVisible())
             m_monitor->slotEffectScene(true);
     } else {
         m_monitor->slotEffectScene(false);