Commit 42e44b5a authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch '2012'

parents 75930b36 a6d5dbc0
Pipeline #41528 passed with stage
in 10 minutes
......@@ -32,6 +32,7 @@ Item {
property int snappedFrame
property double delta: -1
property double oldDelta: 0
property bool startMove: false
visible: root.activeTool === 0
acceptedButtons: Qt.LeftButton | Qt.RightButton
cursorShape: (pressed ? Qt.ClosedHandCursor : ((startMouseArea.drag.active || endMouseArea.drag.active)? Qt.SizeHorCursor: Qt.PointingHandCursor));
......@@ -49,6 +50,7 @@ Item {
oldStartFrame = subtitleRoot.startFrame
snappedFrame = oldStartFrame
x = subtitleBase.x
startMove = mouse.button & Qt.LeftButton
if (timeline.selection.indexOf(subtitleRoot.subId) == -1) {
controller.requestAddToSelection(subtitleRoot.subId, !(mouse.modifiers & Qt.ShiftModifier))
} else if (mouse.modifiers & Qt.ShiftModifier) {
......@@ -57,27 +59,28 @@ Item {
}
}
onPositionChanged: {
if (pressed && !subtitleBase.textEditBegin) {
console.log('MOUSE MOVE: ', oldStartFrame," DELTA: ",((mouseX - oldStartX)/ timeScale))
if (pressed && !subtitleBase.textEditBegin && startMove) {
newStart = oldStartFrame + (mouseX - oldStartX)/ timeScale
snappedFrame = controller.suggestSubtitleMove(subId, newStart, root.consumerPosition, root.snapping)
hasMoved = true
}
}
onReleased: {
console.log('IT IS RELEASED')
if (subtitleBase.textEditBegin) {
mouse.accepted = false
return
}
root.autoScrolling = timeline.autoScroll
if (subtitleBase.x < 0)
subtitleBase.x = 0
if (oldStartFrame != snappedFrame) {
console.log("old start frame",oldStartFrame/timeline.scaleFactor, "new frame afer shifting ",oldStartFrame/timeline.scaleFactor + delta)
//timeline.moveSubtitle(oldStartFrame, newStart, duration)
controller.requestSubtitleMove(subId, oldStartFrame, false, false);
controller.requestSubtitleMove(subId, snappedFrame, true, true);
x = snappedFrame * timeScale
if (startMove) {
startMove = false
if (subtitleBase.x < 0)
subtitleBase.x = 0
if (oldStartFrame != snappedFrame) {
console.log("old start frame",oldStartFrame/timeline.scaleFactor, "new frame afer shifting ",oldStartFrame/timeline.scaleFactor + delta)
controller.requestSubtitleMove(subId, oldStartFrame, false, false);
controller.requestSubtitleMove(subId, snappedFrame, true, true);
x = snappedFrame * timeScale
}
}
console.log('RELEASED DONE\n\n_______________')
}
......
......@@ -888,14 +888,13 @@ Rectangle {
proxy.position = Math.min((scrollView.contentX + mouse.x) / timeline.scaleFactor, timeline.fullDuration - 1)
}
} else if (mouse.button & Qt.RightButton) {
if (mouse.y > ruler.height) {
var offset = 0
if (root.showSubtitles) {
offset = subtitleTrack.height
}
timeline.activeTrack = tracksRepeater.itemAt(Logic.getTrackIndexFromPos(mouse.y - ruler.height + scrollView.contentY - offset)).trackInternalId
if (mouse.y > ruler.height + subtitleTrack.height) {
timeline.activeTrack = tracksRepeater.itemAt(Logic.getTrackIndexFromPos(mouse.y - ruler.height + scrollView.contentY - subtitleTrack.height)).trackInternalId
root.mainFrame = Math.floor((mouse.x + scrollView.contentX) / timeline.scaleFactor)
root.showTimelineMenu()
} else if (mouse.y > ruler.height) {
//TODO:
// subtitle track menu
} else {
// ruler menu
root.showRulerMenu()
......
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