Commit 9d414f57 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Add action to focus active monitor timecode (default shortcut is '=')

parent 71e96e10
Pipeline #69486 passed with stage
in 8 minutes and 39 seconds
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kdenlive" version="201" translationDomain="kdenlive">
<kpartgui name="kdenlive" version="202" translationDomain="kdenlive">
<MenuBar>
<Menu name="file" >
<Action name="file_save"/>
......@@ -239,6 +239,7 @@
<Action name="mlt_mute" />
</Menu>
<Action name="switch_monitor" />
<Action name="focus_timecode" />
</Menu>
<Menu name="view" noMerge="1" ><text>View</text>
<Action name="fullscreen" />
......
......@@ -1419,6 +1419,7 @@ void MainWindow::setupActions()
addAction(QStringLiteral("archive_project"), i18n("Archive Project"), this, SLOT(slotArchiveProject()),
QIcon::fromTheme(QStringLiteral("document-save-all")));
addAction(QStringLiteral("switch_monitor"), i18n("Switch monitor"), this, SLOT(slotSwitchMonitors()), QIcon(), Qt::Key_T);
addAction(QStringLiteral("focus_timecode"), i18n("Focus Timecode"), this, SLOT(slotFocusTimecode()), QIcon(), Qt::Key_Equal);
addAction(QStringLiteral("expand_timeline_clip"), i18n("Expand Clip"), this, SLOT(slotExpandClip()),
QIcon::fromTheme(QStringLiteral("document-open")));
......@@ -3740,6 +3741,15 @@ void MainWindow::slotSwitchMonitors()
}
}
void MainWindow::slotFocusTimecode()
{
if (m_clipMonitor->isActive()) {
m_clipMonitor->focusTimecode();
} else if (m_projectMonitor) {
m_projectMonitor->focusTimecode();
}
}
void MainWindow::slotSwitchMonitorOverlay(QAction *action)
{
if (pCore->monitorManager()->isActive(Kdenlive::ClipMonitor)) {
......
......@@ -468,6 +468,8 @@ private slots:
void slotSetMonitorGamma(int gamma);
void slotCheckRenderStatus();
void slotInsertZoneToTree();
/** @brief Focus the timecode widget of current monitor. */
void slotFocusTimecode();
/** @brief The monitor informs that it needs (or not) to have frames sent by the renderer. */
void slotMonitorRequestRenderFrame(bool request);
......
......@@ -2494,3 +2494,9 @@ void Monitor::slotSwitchRecTimecode(bool enable)
m_timePos->setOffset(m_controller->getRecordTime());
}
}
void Monitor::focusTimecode()
{
m_timePos->setFocus();
m_timePos->selectAll();
}
......@@ -156,6 +156,8 @@ public:
void enableEffectScene(bool enable);
/** @brief Update the document's uuid - used for qml thumb cache*/
void updateDocumentUuid();
/** @brief Focus the timecode to alllow editing*/
void focusTimecode();
protected:
......
......@@ -245,6 +245,11 @@ const QString TimecodeDisplay::displayText() const
return lineEdit()->displayText();
}
void TimecodeDisplay::selectAll()
{
lineEdit()->selectAll();
}
void TimecodeDisplay::setOffset(int offset)
{
m_offset = GenTime(offset/1000.).frames(m_timecode.fps());
......
......@@ -94,6 +94,9 @@ public:
* @param offset the offset in msecs */
void setOffset(int offset);
/** @brief Select all timecode text */
void selectAll();
private:
/** timecode for widget */
Timecode m_timecode;
......
  • Thanks again for this. The "=" is such a time-saver.

    I've been using this even before 21.08.0 and now that I've got into a rhythm I was wandering if I could take the liberty of making one more suggestion and ask if a Ctrl+arrowKey short-cut could place the cursor after the next ":"? For instance, after I press "=" I then Ctrl+leftArrow on to the Seconds. This saves two key strokes. For example the playhead is at 00:06:47:13, I press "=" then Ctrl ← to place me on "7", I change this to "2" and the timecode becomes "00:06:42:13", I then tab and I go back five seconds on the timeline. Thank you once more.

    Edited by Stephen Esseenyne
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