]> git.sesse.net Git - kdenlive/commitdiff
Use label at the bottom of the effect stack instead of tooltips for showing parameter...
authorTill Theato <root@ttill.de>
Sat, 25 Dec 2010 00:24:45 +0000 (00:24 +0000)
committerTill Theato <root@ttill.de>
Sat, 25 Dec 2010 00:24:45 +0000 (00:24 +0000)
http://kdenlive.org/mantis/view.php?id=1939

svn path=/trunk/kdenlive/; revision=5197

src/doubleparameterwidget.cpp
src/doubleparameterwidget.h
src/effectstackedit.cpp
src/effectstackedit.h
src/effectstackview.cpp
src/effectstackview.h
src/keyframeedit.cpp
src/keyframeedit.h
src/widgets/effectstack_ui.ui

index efc28e0bd0254de4cd97268aed08a701c54c8dba..e258dbcbe0ed06b8bf7a8f38566602b9e199663a 100644 (file)
 
 DoubleParameterWidget::DoubleParameterWidget(const QString &name, int value, int min, int max, int defaultValue, const QString &comment, const QString suffix, QWidget *parent) :
         QWidget(parent),
-        m_default(defaultValue)
+        m_default(defaultValue),
+        m_comment(comment)
 {
-    setToolTip(comment);
-
     QHBoxLayout *layout = new QHBoxLayout(this);
     layout->setContentsMargins(0, 0, 0, 0);
 
@@ -60,6 +59,15 @@ DoubleParameterWidget::DoubleParameterWidget(const QString &name, int value, int
     reset->setToolTip(i18n("Reset to default value"));
     layout->addWidget(reset);
 
+    if (m_comment != QString()) {
+        QToolButton *showComment  = new QToolButton(this);
+        showComment->setAutoRaise(true);
+        showComment->setIcon(KIcon("help-about"));
+        layout->addWidget(showComment);
+
+        connect(showComment, SIGNAL(clicked(bool)), this, SLOT(slotShowComment()));
+    }
+
     connect(m_slider,  SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
     connect(m_spinBox, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
     connect(reset,     SIGNAL(clicked(bool)),     this, SLOT(slotReset()));
@@ -96,4 +104,9 @@ void DoubleParameterWidget::slotReset()
     setValue(m_default);
 }
 
+void DoubleParameterWidget::slotShowComment()
+{
+    emit showComment(m_comment);
+}
+
 #include "doubleparameterwidget.moc"
index 0a914a40b9a395e5159f7881563b63bf471cae8d..15fa4a0ec43086c4b9b45c261585845aa937c6b5 100644 (file)
@@ -49,8 +49,10 @@ public:
     * @param suffix (optional) Suffix to display in spinbox
     * @param parent (optional) Parent Widget */
     DoubleParameterWidget(const QString &name, int value, int min, int max, int defaultValue, const QString &comment, const QString suffix = QString(), QWidget* parent = 0);
+
     /** @brief Updates the label to display @param name. */
     void setName(const QString &name);
+
     /** @brief Gets the parameter's value. */
     int getValue();
 
@@ -61,14 +63,20 @@ public slots:
     /** @brief Sets value to m_default. */
     void slotReset();
 
+private slots:
+    /** @brief Emits showComment with m_comment. */
+    void slotShowComment();
+
 private:
     int m_default;
     QLabel *m_name;
     QSlider *m_slider;
     QSpinBox *m_spinBox;
+    QString m_comment;
     
 signals:
     void valueChanged(int);
+    void showComment(const QString&);
 };
 
 #endif
index 3e3f2d070e4c17c18c6d7076409b594b2f06c2f8..56d54dd22ce53d94587006f7940bf834fb23bad4 100644 (file)
@@ -247,6 +247,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
             m_vbox->addWidget(doubleparam);
             m_valueItems[paramName] = doubleparam;
             connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
+            connect(doubleparam, SIGNAL(showComment(const QString&)), this, SIGNAL(showComment(const QString&)));
         } else if (type == "list") {
             Listval *lsval = new Listval;
             lsval->setupUi(toFillin);
@@ -321,6 +322,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
                 m_keyframeEditor = geo;
                 connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
                 connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
+                connect(geo, SIGNAL(showComment(const QString&)), this, SIGNAL(showComment(const QString&)));
             } else {
                 // we already have a keyframe editor, so just add another column for the new param
                 m_keyframeEditor->addParameter(pa);
index d58a97d7fcb794251a7687cd910a7a7f2e54a2a2..9a57416ffa15f30b448bf5f49fbc9fac3048507a 100644 (file)
@@ -84,10 +84,12 @@ private:
 public slots:
     /** @brief Called when an effect is selected, builds the UIĀ for this effect. */
     void transferParamDesc(const QDomElement d, int pos, int in, int out, bool isEffect = true);
+
     /** @brief Called whenever(?) some parameter is changed in the gui.
      *
      * Transfers all Dynamic gui parameter settings into m_params(??) */
     void collectAllParameters();
+
     /** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
     void slotSyncEffectsPos(int pos);
 
@@ -97,6 +99,7 @@ signals:
     void displayMessage(const QString&, int);
     void checkMonitorPosition(int);
     void syncEffectsPos(int pos);
+    void showComment(const QString&);
 };
 
 #endif
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"
index 1c7cb83006e3d6b6c34815eb22660745b6c59fee..c78c02db164dae850c7c59b3c19c08c49e3af868 100644 (file)
@@ -139,6 +139,9 @@ private slots:
     /** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
     void slotRenderPos(int pos);
 
+    /** @brief Sets the parameter explaining comment to @param comment. */
+    void slotUpdateComment(const QString &comment = QString());
+
 signals:
     void removeEffect(ClipItem*, int, QDomElement);
     /**  Parameters for an effect changed, update the filter in playlist */
index 39c512e0ea8186dc693851ecc9b31543cb21c793..b68d82a722c321fe606e50ab2bb53d5baa44143d 100644 (file)
@@ -116,6 +116,7 @@ void KeyframeEdit::addParameter(QDomElement e, int activeKeyframe)
             m_params.at(columnId).attribute("min").toInt(), m_params.at(columnId).attribute("max").toInt(),
             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(doubleparam, SIGNAL(showComment(const QString&)), this, SIGNAL(showComment(const QString&)));
     m_slidersLayout->addWidget(doubleparam, columnId, 0);
 
     QRadioButton *radio = new QRadioButton(this);
index b804da41a1f7b80bd2bab06bc86f28472fc19217..6a2a79461319385652fb53446e18269886c4479c 100644 (file)
@@ -132,6 +132,7 @@ private slots:
 signals:
     void parameterChanged();
     void seekToPos(int);
+    void showComment(const QString&);
 };
 
 #endif
index 875614e1bf4266ea82f02d8035d043ca462473b7..f990940348db659922f565c1fff3eb960e45e777 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>448</width>
-    <height>248</height>
+    <width>451</width>
+    <height>251</height>
    </rect>
   </property>
   <property name="sizePolicy">
       </layout>
      </widget>
      <widget class="QWidget" name="layoutWidget_2">
-      <layout class="QVBoxLayout" name="frame_layout">
-       <item>
+      <layout class="QGridLayout" name="layoutEdit">
+       <item row="0" column="0" colspan="3">
         <widget class="QFrame" name="frame">
          <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
+          <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
         </widget>
        </item>
+       <item row="1" column="1">
+        <widget class="QLabel" name="labelComment">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+         </property>
+         <property name="wordWrap">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
       </layout>
      </widget>
     </widget>