Fix some remaining effectstack layout issues

parent 83a4ab9a
Pipeline #8125 passed with stage
in 22 minutes and 9 seconds
......@@ -109,6 +109,10 @@ void AssetParameterView::setModel(const std::shared_ptr<AssetParameterModel> &mo
connect(this, &AssetParameterView::initKeyframeView, w, &AbstractParamWidget::slotInitMonitor);
connect(w, &AbstractParamWidget::valueChanged, this, &AssetParameterView::commitChanges);
connect(w, &AbstractParamWidget::seekToPos, this, &AssetParameterView::seekToPos);
connect(w, &AbstractParamWidget::updateHeight, [&, w]() {
setFixedHeight(contentHeight());
emit updateHeight();
});
m_lay->addWidget(w);
if (type == ParamType::KeyframeParam || type == ParamType::AnimatedRect || type == ParamType::Roto_spline) {
m_mainKeyframeWidget = static_cast<KeyframeWidget *>(w);
......
......@@ -42,15 +42,15 @@ ClickableLabelParamWidget::ClickableLabelParamWidget(std::shared_ptr<AssetParame
QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
setToolTip(comment);
auto *layout = new QHBoxLayout(this);
QToolButton *tb = new QToolButton(this);
tb->setAutoRaise(true);
tb->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
m_tb = new QToolButton(this);
m_tb->setCursor(Qt::PointingHandCursor);
m_tb->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
m_label = new QLabel(this);
m_label->setWordWrap(true);
layout->addWidget(tb);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_tb);
layout->addWidget(m_label);
setMinimumHeight(tb->sizeHint().height());
connect(tb, &QToolButton::clicked, [&]() {
connect(m_tb, &QToolButton::clicked, [&]() {
QClipboard *clipboard = QApplication::clipboard();
QString value = m_model->data(m_index, AssetParameterModel::ValueRole).toString();
clipboard->setText(value);
......@@ -75,6 +75,8 @@ void ClickableLabelParamWidget::slotRefresh()
QString value = m_model->data(m_index, AssetParameterModel::ValueRole).toString();
m_label->setText(QStringLiteral("<a href=\"%1\">").arg(value) + m_displayName + QStringLiteral("</a>"));
setVisible(!value.isEmpty());
setMinimumHeight(value.isEmpty() ? 0 : m_tb->sizeHint().height());
emit updateHeight();
}
bool ClickableLabelParamWidget::getValue()
......
......@@ -26,6 +26,7 @@
#include <QWidget>
class QPushButton;
class QToolButton;
class QLabel;
/** @brief This class represents a parameter that requires
......@@ -58,6 +59,7 @@ public slots:
private:
QLabel *m_label;
QToolButton *m_tb;
QString m_displayName;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment