]> git.sesse.net Git - kdenlive/commitdiff
Improve visual appearance of effect parameter comments:
authorTill Theato <root@ttill.de>
Mon, 27 Dec 2010 13:18:50 +0000 (13:18 +0000)
committerTill Theato <root@ttill.de>
Mon, 27 Dec 2010 13:18:50 +0000 (13:18 +0000)
http://kdenlive.org/mantis/view.php?id=1939

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

src/doubleparameterwidget.cpp
src/keyframeedit.cpp

index a5a396c46a3ab61c3c54f30f39f04e0aabf52a9c..ed8e23f969bedbc9300de9a0a69ed47761477510 100644 (file)
@@ -36,6 +36,7 @@ DoubleParameterWidget::DoubleParameterWidget(const QString &name, int value, int
 {
     QGridLayout *layout = new QGridLayout(this);
     layout->setContentsMargins(0, 0, 0, 0);
+    layout->setSpacing(0);
 
     m_name = new QLabel(name, this);
     layout->addWidget(m_name, 0, 0);
@@ -60,6 +61,7 @@ DoubleParameterWidget::DoubleParameterWidget(const QString &name, int value, int
 
     m_commentLabel = new QLabel(comment, this);
     m_commentLabel->setWordWrap(true);
+    m_commentLabel->setTextFormat(Qt::RichText);
     m_commentLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
     m_commentLabel->setFrameShape(QFrame::StyledPanel);
     m_commentLabel->setFrameShadow(QFrame::Raised);
@@ -105,8 +107,15 @@ void DoubleParameterWidget::slotReset()
 
 void DoubleParameterWidget::slotShowComment()
 {
-    if (m_commentLabel->text() != QString())
-        m_commentLabel->setHidden(!m_commentLabel->isHidden());
+    if (m_commentLabel->text() != QString()) {
+        if (m_commentLabel->isHidden()) {
+            m_commentLabel->setHidden(false);
+            layout()->setContentsMargins(0, 0, 0, 15);
+        } else {
+            m_commentLabel->setHidden(true);
+            layout()->setContentsMargins(0, 0, 0, 0);
+        }
+    }
 }
 
 #include "doubleparameterwidget.moc"
index 0af0c71afe8b0b2e4dc4ca09dfb0789a9b4f7227..a93bbfc70bffcc1fe0ae2ef30c329945e847d547 100644 (file)
@@ -123,7 +123,12 @@ void KeyframeEdit::addParameter(QDomElement e, int activeKeyframe)
     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++) {