Ensure parent is expanded when making action on a clip

parent e7638efd
Pipeline #16321 passed with stage
in 14 minutes and 49 seconds
......@@ -1705,6 +1705,8 @@ void Bin::slotAddFolder()
// Edit folder name
auto folder = m_itemModel->getFolderByBinId(newId);
auto ix = m_itemModel->getIndexFromItem(folder);
// Scroll to ensure folder is visible
m_itemView->scrollTo(m_proxyModel->mapFromSource(ix), QAbstractItemView::PositionAtCenter);
qDebug() << "selecting" << ix;
if (ix.isValid()) {
qDebug() << "ix valid";
......@@ -2415,6 +2417,12 @@ void Bin::selectClip(const std::shared_ptr<ProjectClip> &clip)
if (id.isValid() && id2.isValid()) {
m_proxyModel->selectionModel()->select(QItemSelection(m_proxyModel->mapFromSource(id), m_proxyModel->mapFromSource(id2)), QItemSelectionModel::SelectCurrent);
}
// Ensure parent folder is expanded
if (m_listType == BinTreeView) {
// Make sure parent folder is expanded
auto *view = static_cast<QTreeView *>(m_itemView);
view->expand(m_proxyModel->mapFromSource(ix.parent()));
}
m_itemView->scrollTo(m_proxyModel->mapFromSource(ix), QAbstractItemView::PositionAtCenter);
}
......
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