Fix crash in effect stack on spacer. Fixes #408

parent 107db117
Pipeline #9486 failed with stage
in 5 minutes and 29 seconds
......@@ -91,6 +91,7 @@ CollapsibleEffectView::CollapsibleEffectView(const std::shared_ptr<EffectItemMod
m_collapse = new KDualAction(i18n("Collapse Effect"), i18n("Expand Effect"), this);
m_collapse->setActiveIcon(QIcon::fromTheme(QStringLiteral("arrow-right")));
collapseButton->setDefaultAction(m_collapse);
m_collapse->setActive(m_model->isCollapsed());
connect(m_collapse, &KDualAction::activeChanged, this, &CollapsibleEffectView::slotSwitch);
if (effectModel->rowCount() == 0) {
// Effect has no paramerter
......@@ -209,8 +210,10 @@ CollapsibleEffectView::CollapsibleEffectView(const std::shared_ptr<EffectItemMod
cb->installEventFilter(this);
cb->setFocusPolicy(Qt::StrongFocus);
}
m_collapse->setActive(m_model->isCollapsed());
QMetaObject::invokeMethod(this, "slotSwitch", Qt::QueuedConnection, Q_ARG(bool, m_model->isCollapsed()));
if (m_model->isCollapsed()) {
widgetFrame->setFixedHeight(0);
setFixedHeight(widgetFrame->height() + frame->minimumHeight() + 2 * (contentsMargins().top() + decoframe->lineWidth()));
}
}
CollapsibleEffectView::~CollapsibleEffectView()
......
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