setValue(m_default);
}
-void DoubleParameterWidget::slotShowComment()
+void DoubleParameterWidget::slotShowComment( bool show)
{
if (m_commentLabel->text() != QString()) {
- if (m_commentLabel->isHidden()) {
- m_commentLabel->setHidden(false);
+ m_commentLabel->setVisible(show);
+ if (show)
layout()->setContentsMargins(0, 0, 0, 15);
- } else {
- m_commentLabel->setHidden(true);
+ else
layout()->setContentsMargins(0, 0, 0, 0);
- }
}
}
private slots:
/** @brief Shows/Hides the comment label. */
- void slotShowComment();
+ void slotShowComment(bool show);
private:
int m_default;
m_vbox->addWidget(doubleparam);
m_valueItems[paramName] = doubleparam;
connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
- connect(this, SIGNAL(showComments()), doubleparam, SLOT(slotShowComment()));
+ connect(this, SIGNAL(showComments(bool)), doubleparam, SLOT(slotShowComment(bool)));
} else if (type == "list") {
Listval *lsval = new Listval;
lsval->setupUi(toFillin);
bval->setupUi(toFillin);
bval->checkBox->setCheckState(value == "0" ? Qt::Unchecked : Qt::Checked);
bval->name->setText(paramName);
+ bval->labelComment->setText(comment);
+ bval->labelComment->setHidden(true);
m_valueItems[paramName] = bval;
connect(bval->checkBox, SIGNAL(stateChanged(int)) , this, SLOT(collectAllParameters()));
+ if (!comment.isEmpty())
+ connect(this, SIGNAL(showComments(bool)), bval->labelComment, SLOT(setVisible(bool)));
m_uiItems.append(bval);
} else if (type == "complex") {
ComplexParameter *pl = new ComplexParameter;
m_keyframeEditor = geo;
connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
- connect(this, SIGNAL(showComments()), geo, SIGNAL(showComments()));
+ connect(this, SIGNAL(showComments(bool)), geo, SIGNAL(showComments(bool)));
} else {
// we already have a keyframe editor, so just add another column for the new param
m_keyframeEditor->addParameter(pa);
void displayMessage(const QString&, int);
void checkMonitorPosition(int);
void syncEffectsPos(int pos);
- void showComments();
+ void showComments(bool show);
void effectStateChanged(bool enabled);
};
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(monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
- connect(this, SIGNAL(showComments()), m_effectedit, SIGNAL(showComments()));
+ connect(this, SIGNAL(showComments(bool)), m_effectedit, SIGNAL(showComments(bool)));
m_effectLists["audio"] = &MainWindow::audioEffects;
m_effectLists["video"] = &MainWindow::videoEffects;
m_effectLists["custom"] = &MainWindow::customEffects;
m_ui.frame->setEnabled(isChecked);
m_ui.buttonShowComments->setEnabled(hasItem);
- if (m_ui.buttonShowComments->isChecked())
- emit showComments();
+ emit showComments(m_ui.buttonShowComments->isChecked());
m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || !m_ui.labelComment->text().count() || !hasItem);
}
}
}
- if (m_ui.buttonShowComments->isChecked())
- emit showComments();
+ emit showComments(m_ui.buttonShowComments->isChecked());
m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || !m_ui.labelComment->text().count());
}
void EffectStackView::slotShowComments()
{
m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || !m_ui.labelComment->text().count());
- emit showComments();
+ emit showComments(m_ui.buttonShowComments->isChecked());
}
#include "effectstackview.moc"
/** The region effect for current effect was changed */
void updateClipRegion(ClipItem*, int, QString);
void displayMessage(const QString&, int);
- void showComments();
+ void showComments(bool show);
};
#endif
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(this, SIGNAL(showComments()), doubleparam, SLOT(slotShowComment()));
+ connect(this, SIGNAL(showComments(bool)), doubleparam, SLOT(slotShowComment(bool)));
m_slidersLayout->addWidget(doubleparam, columnId, 0);
QRadioButton *radio = new QRadioButton(this);
signals:
void parameterChanged();
void seekToPos(int);
- void showComments();
+ void showComments(bool show);
};
#endif
<rect>
<x>0</x>
<y>0</y>
- <width>326</width>
- <height>30</height>
+ <width>329</width>
+ <height>43</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
</property>
</widget>
</item>
+ <item row="1" column="0" colspan="2">
+ <widget class="QLabel" name="labelComment">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<resources/>