Select subtitle item when moving between subtitles from the widget

parent 299cd9e3
......@@ -270,6 +270,13 @@ void Core::selectBinClip(const QString &clipId, int frame, const QPoint &zone)
m_binWidget->selectClipById(clipId, frame, zone);
}
void Core::selectTimelineItem(int id)
{
if (m_guiConstructed && m_mainWindow->getCurrentTimeline()->controller()->getModel()) {
m_mainWindow->getCurrentTimeline()->controller()->getModel()->requestAddToSelection(id, true);
}
}
std::shared_ptr<JobManager> Core::jobManager()
{
return m_jobManager;
......
......@@ -109,6 +109,8 @@ public:
Bin *bin();
/** @brief Select a clip in the Bin from its id. */
void selectBinClip(const QString &id, int frame = -1, const QPoint &zone = QPoint());
/** @brief Selects an item in the current timeline (clip, composition, subtitle). */
void selectTimelineItem(int id);
/** @brief Returns a pointer to the model of the project bin. */
std::shared_ptr<ProjectItemModel> projectItemModel();
/** @brief Returns a pointer to the job manager. Please do not store it. */
......
......@@ -122,7 +122,7 @@ void SubtitleEdit::goToPrevious()
}
GenTime prev = m_model->getStartPosForId(id);
pCore->getMonitor(Kdenlive::ProjectMonitor)->requestSeek(prev.frames(pCore->getCurrentFps()));
setActiveSubtitle(id);
pCore->selectTimelineItem(id);
}
}
}
......@@ -137,7 +137,7 @@ void SubtitleEdit::goToNext()
}
GenTime prev = m_model->getStartPosForId(id);
pCore->getMonitor(Kdenlive::ProjectMonitor)->requestSeek(prev.frames(pCore->getCurrentFps()));
setActiveSubtitle(id);
pCore->selectTimelineItem(id);
}
}
}
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