Click on track Led to toggle track target

Ref: T1961
parent 7c1e3f43
......@@ -7780,7 +7780,7 @@ QStringList CustomTrackView::selectedClips() const
return clipIds;
}
void CustomTrackView::slotSelectTrack(int ix)
void CustomTrackView::slotSelectTrack(int ix, bool switchTarget)
{
m_selectedTrack = qBound(1, ix, m_timeline->tracksCount() - 1);
emit updateTrackHeaders();
......@@ -7788,6 +7788,8 @@ void CustomTrackView::slotSelectTrack(int ix)
QRectF rect(mapToScene(QPoint(10, 0)).x(), getPositionFromTrack(ix) , 10, m_tracksHeight);
ensureVisible(rect, 0, 0);
viewport()->update();
if (switchTarget)
m_timeline->switchTrackTarget();
}
void CustomTrackView::slotSelectClipsInTrack()
......
......@@ -307,7 +307,7 @@ public slots:
void clipNameChanged(const QString &id);
void slotTrackUp();
void slotTrackDown();
void slotSelectTrack(int ix);
void slotSelectTrack(int ix, bool switchTarget = false);
void insertZone(TimelineMode::EditMode sceneMode, const QString clipId, QPoint binZone);
/** @brief Rebuilds a group to fit again after children changed.
......
......@@ -171,7 +171,8 @@ void HeaderTrack::mousePressEvent(QMouseEvent * event)
if (track_number->hasFocus()) {
track_number->clearFocus();
}
emit selectTrack(m_parentTrack->index());
QWidget *underMouse = childAt(event->pos());
emit selectTrack(m_parentTrack->index(), underMouse == kled);
QWidget::mousePressEvent(event);
}
......
......@@ -86,7 +86,7 @@ signals:
void switchTrackComposite(int index,bool);
void switchTrackLock(int index,bool);
void renameTrack(int index, const QString&name);
void selectTrack(int index);
void selectTrack(int index, bool switchTarget = false);
void configTrack();
void addTrackEffect(const QDomElement &, int index);
};
......
......@@ -295,7 +295,7 @@ int Timeline::getTracks() {
connect(tk->trackHeader, SIGNAL(switchTrackVideo(int,bool)), m_trackview, SLOT(slotSwitchTrackVideo(int,bool)));
connect(tk->trackHeader, SIGNAL(switchTrackAudio(int,bool)), m_trackview, SLOT(slotSwitchTrackAudio(int,bool)));
connect(tk->trackHeader, SIGNAL(switchTrackLock(int,bool)), m_trackview, SLOT(slotSwitchTrackLock(int,bool)));
connect(tk->trackHeader, SIGNAL(selectTrack(int)), m_trackview, SLOT(slotSelectTrack(int)));
connect(tk->trackHeader, SIGNAL(selectTrack(int,bool)), m_trackview, SLOT(slotSelectTrack(int,bool)));
connect(tk->trackHeader, SIGNAL(renameTrack(int,QString)), this, SLOT(slotRenameTrack(int,QString)));
connect(tk->trackHeader, SIGNAL(configTrack()), this, SIGNAL(configTrack()));
connect(tk->trackHeader, SIGNAL(addTrackEffect(QDomElement,int)), m_trackview, SLOT(slotAddTrackEffect(QDomElement,int)));
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>217</width>
<height>32</height>
<width>254</width>
<height>38</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -59,6 +59,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="look">
<enum>KLed::Sunken</enum>
</property>
......
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