Fix audio/video only drag icons not very visible, only show them on AV clips

parent 20771ba4
......@@ -1386,11 +1386,13 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i
m_audioMeterWidget->audioChannels = controller->audioInfo() ? controller->audioInfo()->channels() : 0;
m_glMonitor->setAudioThumb(controller->audioChannels(), controller->audioFrameCache);
m_controller->getMarkerModel()->registerSnapModel(m_snaps);
m_glMonitor->getControllerProxy()->setClipHasAV(controller->hasAudioAndVideo());
// hasEffects = controller->hasEffects();
} else {
m_glMonitor->setProducer(nullptr, isActive());
m_glMonitor->setAudioThumb();
m_audioMeterWidget->audioChannels = 0;
m_glMonitor->getControllerProxy()->setClipHasAV(false);
}
if (slotActivateMonitor()) {
start();
......
......@@ -42,6 +42,7 @@ MonitorProxy::MonitorProxy(GLWidget *parent)
, m_seekPosition(-1)
, m_zoneIn(0)
, m_zoneOut(-1)
, m_hasAV(false)
{
}
......@@ -279,3 +280,14 @@ QString MonitorProxy::toTimecode(int frames) const
{
return KdenliveSettings::frametimecode() ? QString::number(frames) : q->frameToTime(frames);
}
bool MonitorProxy::clipHasAV() const
{
return m_hasAV;
}
void MonitorProxy::setClipHasAV(bool hasAV)
{
m_hasAV = hasAV;
emit clipHasAVChanged();
}
......@@ -42,6 +42,7 @@ class MonitorProxy : public QObject
Q_PROPERTY(int rulerHeight READ rulerHeight NOTIFY rulerHeightChanged)
Q_PROPERTY(QString markerComment READ markerComment NOTIFY markerCommentChanged)
Q_PROPERTY(int overlayType READ overlayType WRITE setOverlayType NOTIFY overlayTypeChanged)
Q_PROPERTY(bool clipHasAV READ clipHasAV NOTIFY clipHasAVChanged)
public:
MonitorProxy(GLWidget *parent);
......@@ -53,6 +54,9 @@ public:
int rulerHeight() const;
int overlayType() const;
void setOverlayType(int ix);
/** brief: Returns true if current clip in monitor has Audio and Video
* */
bool clipHasAV() const;
QString markerComment() const;
Q_INVOKABLE void requestSeekPosition(int pos);
/** brief: Returns seek position or consumer position when not seeking
......@@ -78,6 +82,7 @@ public:
QPoint zone() const;
QImage extractFrame(int frame_position, const QString &path = QString(), int width = -1, int height = -1, bool useSourceProfile = false);
Q_INVOKABLE QString toTimecode(int frames) const;
void setClipHasAV(bool hasAV);
signals:
void positionChanged();
......@@ -95,6 +100,7 @@ signals:
void seekPreviousKeyframe();
void addRemoveKeyframe();
void seekToKeyframe();
void clipHasAVChanged();
private:
GLWidget *q;
......@@ -102,6 +108,7 @@ private:
int m_seekPosition;
int m_zoneIn;
int m_zoneOut;
bool m_hasAV;
QString m_markerComment;
};
......
......@@ -8,8 +8,7 @@ Rectangle {
objectName: "effecttoolbar"
width: fullscreenButton.width
height: childrenRect.height
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
color: Qt.rgba(myPalette.window.r, myPalette.window.g, myPalette.window.b, 0.7)
color: Qt.rgba(activePalette.window.r, activePalette.window.g, activePalette.window.b, 0.7)
radius: 4
border.color : Qt.rgba(0, 0, 0, 0.3)
border.width: 1
......
......@@ -26,6 +26,7 @@ Item {
property bool showSafezone
property bool showAudiothumb
property bool showToolbar: false
property bool hasAV: controller.clipHasAV
property real baseUnit: fontMetrics.font.pixelSize * 0.8
property int duration: 300
property int mouseRulerPos: 0
......@@ -209,13 +210,13 @@ Item {
hoverEnabled: true
acceptedButtons: Qt.LeftButton
x: 0
width: 2 * audioDragButton.width
height: 2.5 * audioDragButton.height
width: parent.width
height: 2 * audioDragButton.height
y: parent.height - height
propagateComposedEvents: true
onPressed: {
// First found child is the Column
var clickedChild = childAt(mouseX,mouseY).childAt(mouseX,mouseY)
var clickedChild = childAt(mouseX,mouseY) ? childAt(mouseX,mouseY).childAt(mouseX,mouseY).childAt(mouseX,mouseY) : ""
if (clickedChild == audioDragButton) {
dragType = 1
} else if (clickedChild == videoDragButton) {
......@@ -225,22 +226,26 @@ Item {
}
mouse.accepted = false
}
Column {
Rectangle {
x: 5
width: childrenRect.width
height: childrenRect.height
color: Qt.rgba(activePalette.window.r, activePalette.window.g, activePalette.window.b, 0.5)
radius: 4
visible: root.hasAV && dragOverArea.containsMouse
Row {
ToolButton {
id: videoDragButton
iconName: "kdenlive-show-video"
tooltip: "Video only drag"
x: 10
enabled: false
visible: dragOverArea.containsMouse
}
ToolButton {
id: audioDragButton
iconName: "audio-volume-medium"
tooltip: "Audio only drag"
x: 10
enabled: false
visible: dragOverArea.containsMouse
}
}
}
}
......
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