Fix activate track target shortcut always activating first stream.

Related to #225
parent 168e486a
......@@ -1744,7 +1744,7 @@ void MainWindow::setupActions()
connect(ac2, &QAction::triggered, this, &MainWindow::slotActivateVideoTrackSequence);
addAction(QString("activate_video_%1").arg(i), ac2, QKeySequence(keysequence[i-1]), timelineActions);
QAction *ac3 = new QAction(QIcon(), i18n("Select Target %1", i), this);
ac2->setData(i - 1);
ac3->setData(i - 1);
connect(ac3, &QAction::triggered, this, &MainWindow::slotActivateTarget);
addAction(QString("activate_target_%1").arg(i), ac3, QKeySequence(Qt::Key_Q, keysequence[i-1]), timelineActions);
}
......@@ -4107,8 +4107,10 @@ void MainWindow::slotActivateVideoTrackSequence()
void MainWindow::slotActivateTarget()
{
auto *action = qobject_cast<QAction *>(sender());
const QList<int> trackIds = getMainTimeline()->controller()->getModel()->getTracksIds(false);
getCurrentTimeline()->controller()->assignCurrentTarget(action->data().toInt());
if (action) {
int ix = action->data().toInt();
getCurrentTimeline()->controller()->assignCurrentTarget(ix);
}
}
#ifdef DEBUG_MAINW
......
......@@ -173,7 +173,7 @@ Rectangle {
}
}
ToolTip {
visible: targetArea.containsMouse
visible: targetArea.containsMouse && !targetMouse.hovered
font: miniFont
delay: 1500
timeout: 5000
......
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