Don't activate clip tools (add compo/fades) when clicking on a composition

parent 4d731e2d
Pipeline #1614 passed with stage
in 14 minutes and 10 seconds
...@@ -441,7 +441,7 @@ Rectangle { ...@@ -441,7 +441,7 @@ Rectangle {
border.width: 2 border.width: 2
border.color: 'green' border.color: 'green'
opacity: 0 opacity: 0
enabled: !clipRoot.isAudio enabled: !clipRoot.isAudio && !dragProxy.isComposition
MouseArea { MouseArea {
id: compInArea id: compInArea
anchors.fill: parent anchors.fill: parent
...@@ -491,13 +491,16 @@ Rectangle { ...@@ -491,13 +491,16 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onEntered: parent.opacity = 0.7 onEntered: {
parent.opacity = 0.7
parent.visible = true
}
onExited: { onExited: {
if (!pressed) { parent.opacity = 0
parent.opacity = 0 parent.visible = false
}
} }
onPressed: { onPressed: {
parent.visible = false
timeline.addCompositionToClip('', clipRoot.clipId, clipRoot.clipDuration - 1) timeline.addCompositionToClip('', clipRoot.clipId, clipRoot.clipDuration - 1)
} }
ToolTip { ToolTip {
...@@ -540,7 +543,7 @@ Rectangle { ...@@ -540,7 +543,7 @@ Rectangle {
color: '#FF66FFFF' color: '#FF66FFFF'
border.width: 2 border.width: 2
border.color: 'green' border.color: 'green'
enabled: !isLocked enabled: !isLocked && !dragProxy.isComposition
opacity: 0 opacity: 0
Drag.active: fadeInMouseArea.drag.active Drag.active: fadeInMouseArea.drag.active
MouseArea { MouseArea {
...@@ -639,7 +642,7 @@ Rectangle { ...@@ -639,7 +642,7 @@ Rectangle {
border.width: 2 border.width: 2
border.color: 'red' border.color: 'red'
opacity: 0 opacity: 0
enabled: !isLocked enabled: !isLocked && !dragProxy.isComposition
Drag.active: fadeOutMouseArea.drag.active Drag.active: fadeOutMouseArea.drag.active
MouseArea { MouseArea {
id: fadeOutMouseArea id: fadeOutMouseArea
......
...@@ -118,17 +118,6 @@ Item { ...@@ -118,17 +118,6 @@ Item {
anchors.fill: displayRect anchors.fill: displayRect
acceptedButtons: Qt.RightButton acceptedButtons: Qt.RightButton
hoverEnabled: true hoverEnabled: true
/*onPressed: {
root.stopScrolling = true
originalX = compositionRoot.x
originalTrackId = compositionRoot.trackId
startX = compositionRoot.x
compositionRoot.forceActiveFocus();
focus = true
if (!compositionRoot.selected) {
compositionRoot.clicked(compositionRoot, mouse.modifiers === Qt.ShiftModifier)
}
}*/
Keys.onShortcutOverride: event.accepted = compositionRoot.isGrabbed && (event.key === Qt.Key_Left || event.key === Qt.Key_Right || event.key === Qt.Key_Up || event.key === Qt.Key_Down) Keys.onShortcutOverride: event.accepted = compositionRoot.isGrabbed && (event.key === Qt.Key_Left || event.key === Qt.Key_Right || event.key === Qt.Key_Up || event.key === Qt.Key_Down)
Keys.onLeftPressed: { Keys.onLeftPressed: {
controller.requestCompositionMove(compositionRoot.clipId, compositionRoot.originalTrackId, compositionRoot.modelStart - 1, true, true) controller.requestCompositionMove(compositionRoot.clipId, compositionRoot.originalTrackId, compositionRoot.modelStart - 1, true, true)
......
...@@ -1427,15 +1427,19 @@ void TimelineController::switchEnableState(int clipId) ...@@ -1427,15 +1427,19 @@ void TimelineController::switchEnableState(int clipId)
void TimelineController::addCompositionToClip(const QString &assetId, int clipId, int offset) void TimelineController::addCompositionToClip(const QString &assetId, int clipId, int offset)
{ {
int track = m_model->getClipTrackId(clipId); int track = m_model->getClipTrackId(clipId);
int compoId = -1;
if (assetId.isEmpty()) { if (assetId.isEmpty()) {
QStringList compositions = KdenliveSettings::favorite_transitions(); QStringList compositions = KdenliveSettings::favorite_transitions();
if (compositions.isEmpty()) { if (compositions.isEmpty()) {
pCore->displayMessage(i18n("Select a favorite composition"), InformationMessage, 500); pCore->displayMessage(i18n("Select a favorite composition"), InformationMessage, 500);
return; return;
} }
insertNewComposition(track, clipId, offset, compositions.first(), true); compoId = insertNewComposition(track, clipId, offset, compositions.first(), true);
} else { } else {
insertNewComposition(track, clipId, offset, assetId, true); compoId = insertNewComposition(track, clipId, offset, assetId, true);
}
if (compoId > 0) {
m_model->requestSetSelection({compoId});
} }
} }
......
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