Add arrow button in track targets to switch stream

parent 71ffcac6
Pipeline #20636 passed with stage
in 9 minutes and 27 seconds
......@@ -101,7 +101,7 @@ Rectangle {
}
width: 2 * fontMetrics.boundingRect("M").width
height: trackHeadRoot.height
verticalAlignment: Text.AlignVCenter
verticalAlignment: Text.AlignTop
horizontalAlignment: Text.AlignHCenter
visible: trackHeadRoot.isAudio ? timeline.hasAudioTarget > 0 : timeline.hasVideoTarget
anchors.top: parent.top
......@@ -134,6 +134,26 @@ Rectangle {
}
}
}
ToolButton {
focusPolicy: Qt.NoFocus
visible: trackHeadRoot.isAudio && timeline.clipTargets > 1 && trackHeadRoot.height > (2 * expandButton.height)
background: Rectangle {
color: Qt.darker(trackTarget.bgColor, 1.5)
border.color: activePalette.light
}
anchors.bottom: parent.bottom
width: parent.width
height: width
contentItem: Item {
Image {
source: "image://icon/go-down"
anchors.fill: parent
}
}
onClicked: {
root.showTargetMenu(trackId)
}
}
}
ToolTip {
visible: targetArea.containsMouse
......
......@@ -2553,6 +2553,11 @@ int TimelineController::hasAudioTarget() const
return m_hasAudioTarget;
}
int TimelineController::clipTargets() const
{
return m_model->m_binAudioTargets.size();
}
bool TimelineController::hasVideoTarget() const
{
return m_hasVideoTarget;
......
......@@ -69,6 +69,7 @@ class TimelineController : public QObject
Q_PROPERTY(int hasAudioTarget READ hasAudioTarget NOTIFY hasAudioTargetChanged)
Q_PROPERTY(bool hasVideoTarget READ hasVideoTarget NOTIFY hasVideoTargetChanged)
Q_PROPERTY(int clipTargets READ clipTargets NOTIFY hasAudioTargetChanged)
Q_PROPERTY(bool autoScroll READ autoScroll NOTIFY autoScrollChanged)
Q_PROPERTY(QColor videoColor READ videoColor NOTIFY colorsChanged)
Q_PROPERTY(QColor audioColor READ audioColor NOTIFY colorsChanged)
......@@ -155,6 +156,7 @@ public:
Q_INVOKABLE const QString audioTargetName(int tid) const;
Q_INVOKABLE int videoTarget() const;
Q_INVOKABLE int hasAudioTarget() const;
Q_INVOKABLE int clipTargets() const;
Q_INVOKABLE bool hasVideoTarget() const;
Q_INVOKABLE bool autoScroll() const;
Q_INVOKABLE int activeTrack() const { return m_activeTrack; }
......
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