]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackview.cpp
Use label at the bottom of the effect stack instead of tooltips for showing parameter...
[kdenlive] / src / effectstackview.cpp
index 212a698cee38b0d5b39d971e1f722fb959b6831d..e5d02ab61bccbe231c4d5753b503412e795bf04e 100644 (file)
@@ -51,7 +51,7 @@ EffectStackView::EffectStackView(Monitor *monitor, QWidget *parent) :
     vbox1->setContentsMargins(0, 0, 0, 0);
     vbox1->setSpacing(0);
     vbox1->addWidget(m_effectedit);
-    m_ui.frame->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
+
     //m_ui.region_url->fileDialog()->setFilter(ProjectList::getExtensions());
     //m_ui.effectlist->horizontalHeader()->setVisible(false);
     //m_ui.effectlist->verticalHeader()->setVisible(false);
@@ -70,7 +70,6 @@ EffectStackView::EffectStackView(Monitor *monitor, QWidget *parent) :
     m_ui.buttonReset->setToolTip(i18n("Reset effect"));
     m_ui.checkAll->setToolTip(i18n("Enable/Disable all effects"));
 
-
     m_ui.effectlist->setDragDropMode(QAbstractItemView::NoDragDrop); //use internal if drop is recognised right
 
     //connect(m_ui.region_url, SIGNAL(urlSelected(const KUrl &)), this , SLOT(slotRegionChanged()));
@@ -87,12 +86,16 @@ EffectStackView::EffectStackView(Monitor *monitor, QWidget *parent) :
     connect(m_effectedit, SIGNAL(seekTimeline(int)), this , SLOT(slotSeekTimeline(int)));
     connect(m_effectedit, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
     connect(m_effectedit, SIGNAL(checkMonitorPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
+    connect(m_effectedit, SIGNAL(showComment(const QString&)), this, SLOT(slotUpdateComment(const QString&)));
     connect(monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
     m_effectLists["audio"] = &MainWindow::audioEffects;
     m_effectLists["video"] = &MainWindow::videoEffects;
     m_effectLists["custom"] = &MainWindow::customEffects;
     m_ui.splitter->setStretchFactor(1, 10);
     m_ui.splitter->setStretchFactor(0, 1);
+
+    m_ui.labelComment->setHidden(true);
+
     setEnabled(false);
 }
 
@@ -201,6 +204,8 @@ void EffectStackView::slotClipItemSelected(ClipItem* c, int ix)
     m_trackMode = false;
     m_currentEffectList = m_clipref->effectList();
     setupListView(ix);
+
+    slotUpdateComment();
 }
 
 void EffectStackView::slotTrackItemSelected(int ix, const TrackInfo info)
@@ -215,13 +220,14 @@ void EffectStackView::slotTrackItemSelected(int ix, const TrackInfo info)
     m_ui.checkAll->setText(i18n("Effects for track %1").arg(info.trackName.isEmpty() ? QString::number(ix) : info.trackName));
     m_trackindex = ix;
     setupListView(0);
+    slotUpdateComment();
 }
 
 void EffectStackView::slotItemChanged(QListWidgetItem *item)
 {
     bool disable = true;
     if (item->checkState() == Qt::Checked) disable = false;
-    m_ui.frame_layout->setEnabled(!disable);
+    m_ui.frame->setEnabled(!disable);
     m_ui.buttonReset->setEnabled(!disable);
     int activeRow = m_ui.effectlist->currentRow();
     if (activeRow >= 0) {
@@ -320,7 +326,8 @@ void EffectStackView::slotItemSelectionChanged(bool update)
     m_ui.buttonReset->setEnabled(hasItem && isChecked);
     m_ui.buttonUp->setEnabled(activeRow > 0);
     m_ui.buttonDown->setEnabled((activeRow < m_ui.effectlist->count() - 1) && hasItem);
-    m_ui.frame_layout->setEnabled(isChecked);
+    m_ui.frame->setEnabled(isChecked);
+    slotUpdateComment();
 }
 
 void EffectStackView::slotItemUp()
@@ -343,8 +350,10 @@ void EffectStackView::slotItemDel()
 {
     int activeRow = m_ui.effectlist->currentRow();
     if (activeRow >= 0) {
-        if (m_trackMode) emit removeEffect(NULL, m_trackindex, m_currentEffectList.at(activeRow).cloneNode().toElement());
-        else emit removeEffect(m_clipref, -1, m_clipref->effectAt(activeRow));
+        if (m_trackMode)
+            emit removeEffect(NULL, m_trackindex, m_currentEffectList.at(activeRow).cloneNode().toElement());
+        else
+            emit removeEffect(m_clipref, -1, m_clipref->effectAt(activeRow));
         slotUpdateCheckAllButton();
     }
 }
@@ -486,4 +495,14 @@ int EffectStackView::isTrackMode(bool *ok) const
     return m_trackindex;
 }
 
+void EffectStackView::slotUpdateComment(const QString& comment)
+{
+    if (comment == m_ui.labelComment->text())
+        m_ui.labelComment->setText(QString());
+    else
+        m_ui.labelComment->setText(comment);
+
+    m_ui.labelComment->setHidden(m_ui.labelComment->text() == QString());
+}
+
 #include "effectstackview.moc"