Fix disabling effect stack not correctly passed between effectstack and track headers and

ensure timeline view correctly updates on fade insert/delete
parent b33cb353
......@@ -201,6 +201,7 @@ signals:
void compositionTrackChanged();
void replugEffect(std::shared_ptr<AssetParameterModel> asset);
void rebuildEffect(std::shared_ptr<AssetParameterModel> asset);
void enabledChange(bool);
};
#endif
......@@ -198,6 +198,7 @@ void EffectItemModel::updateEnable()
if (auto ptr = m_model.lock()) {
QModelIndex index = ptr->getIndexFromId(m_id);
emit dataChanged(index, index, QVector<int>());
emit enabledChange(!isEnabled());
} else {
qDebug() << "Error, unable to send update to deleted model";
Q_ASSERT(false);
......
......@@ -114,6 +114,7 @@ CollapsibleEffectView::CollapsibleEffectView(std::shared_ptr<EffectItemModel> ef
m_enabledButton->setActiveIcon(QIcon::fromTheme(QStringLiteral("hint")));
m_enabledButton->setInactiveIcon(QIcon::fromTheme(QStringLiteral("visibility")));
enabledButton->setDefaultAction(m_enabledButton);
connect(m_model.get(), &AssetParameterModel::enabledChange, m_enabledButton, &KDualAction::setActive);
m_groupAction = new QAction(QIcon::fromTheme(QStringLiteral("folder-new")), i18n("Create Group"), this);
connect(m_groupAction, &QAction::triggered, this, &CollapsibleEffectView::slotCreateGroup);
......
......@@ -53,11 +53,13 @@ ClipModel::ClipModel(std::shared_ptr<TimelineModel> parent, std::shared_ptr<Mlt:
} else {
m_endlessResize = false;
}
QObject::connect(m_effectStack.get(), &EffectStackModel::dataChanged, [&](){
QObject::connect(m_effectStack.get(), &EffectStackModel::dataChanged, [&](const QModelIndex&, const QModelIndex&, QVector<int> roles){
qDebug()<<"// GOT CLIP STACK DATA CHANGE: "<<roles;
if (m_currentTrackId != -1) {
if (auto ptr = m_parent.lock()) {
QModelIndex ix = ptr->makeClipIndexFromID(m_id);
ptr->dataChanged(ix, ix, {TimelineModel::EffectNamesRole,TimelineModel::FadeInRole,TimelineModel::FadeOutRole});
qDebug()<<"// GOT CLIP STACK DATA CHANGE DONE: "<<ix<<" = "<<roles;
ptr->dataChanged(ix, ix, roles);
}
}
});
......
......@@ -53,10 +53,10 @@ TrackModel::TrackModel(const std::weak_ptr<TimelineModel> &parent, int id, const
}
m_track->set("kdenlive:trackheight", KdenliveSettings::trackheight());
m_effectStack = EffectStackModel::construct(m_track, {ObjectType::TimelineTrack, m_id}, ptr->m_undoStack);
QObject::connect(m_effectStack.get(), &EffectStackModel::dataChanged, [&](){
QObject::connect(m_effectStack.get(), &EffectStackModel::dataChanged, [&](const QModelIndex&, const QModelIndex&, QVector<int> roles){
if (auto ptr2 = m_parent.lock()) {
QModelIndex ix = ptr2->makeTrackIndexFromID(m_id);
ptr2->dataChanged(ix, ix, {TimelineModel::EffectNamesRole});
ptr2->dataChanged(ix, ix, roles);
}
});
} else {
......
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