From: Till Theato Date: Mon, 27 Dec 2010 13:18:50 +0000 (+0000) Subject: Improve visual appearance of effect parameter comments: X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=3446145e27bf689decff9a2b5eeed729029690f4;p=kdenlive Improve visual appearance of effect parameter comments: http://kdenlive.org/mantis/view.php?id=1939 svn path=/trunk/kdenlive/; revision=5207 --- diff --git a/src/doubleparameterwidget.cpp b/src/doubleparameterwidget.cpp index a5a396c4..ed8e23f9 100644 --- a/src/doubleparameterwidget.cpp +++ b/src/doubleparameterwidget.cpp @@ -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" diff --git a/src/keyframeedit.cpp b/src/keyframeedit.cpp index 0af0c71a..a93bbfc7 100644 --- a/src/keyframeedit.cpp +++ b/src/keyframeedit.cpp @@ -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++) {