Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
a6d5dbc0
Commit
a6d5dbc0
authored
Nov 19, 2020
by
Jean-Baptiste Mardelle
Browse files
Don't move subtitle on right mouse click
parent
f87002ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/SubTitle.qml
View file @
a6d5dbc0
...
...
@@ -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
_______________
'
)
}
...
...
src/timeline2/view/qml/timeline.qml
View file @
a6d5dbc0
...
...
@@ -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
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment