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
2ad81743
Commit
2ad81743
authored
Aug 21, 2020
by
Sashmita Raghav
Browse files
Correct end resizing of subtitle clips
parent
f1de3703
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/timeline.qml
View file @
2ad81743
...
...
@@ -1466,7 +1466,7 @@ Rectangle {
z
:
20
property
int
duration
:
(
model
.
endframe
-
model
.
startframe
)
*
timeScale
Rectangle
{
id
:
subtitle
Start
Base
id
:
subtitleBase
width
:
duration
height
:
tracksContainer
.
height
x
:
model
.
startframe
*
timeScale
;
...
...
@@ -1488,9 +1488,7 @@ Rectangle {
subtitleEdit
.
focus
=
false
timeline
.
editSubtitle
(
subtitleBase
.
x
/
timeline
.
scaleFactor
,
subtitleEdit
.
displayText
,
(
subtitleBase
.
x
+
subtitleBase
.
width
)
/
timeline
.
scaleFactor
)
}
anchors
{
bottom
:
parent
.
bottom
}
anchors.fill
:
parent
visible
:
true
&&
text
!=
""
text
:
model
.
subtitle
height
:
subtitleBase
.
height
...
...
@@ -1511,24 +1509,25 @@ Rectangle {
// end position resize handle
id
:
rightend
width
:
4
height
:
parent
.
height
height
:
subtitleBase
.
height
x
:
model
.
endframe
*
timeScale
;
anchors.right
:
subtitleBase
.
right
anchors.top
:
subtitleBase
.
top
color
:
'
blue
'
// to distinguish the resize handle
Drag.active
:
endMouseArea
.
drag
.
active
Drag.proposedAction
:
Qt
.
MoveAction
//
Drag.active: endMouseArea.drag.active
//
Drag.proposedAction: Qt.MoveAction
visible
:
true
MouseArea
{
id
:
endMouseArea
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.fill
:
parent
height
:
parent
.
height
width
:
4
hoverEnabled
:
true
enabled
:
pressed
enabled
:
true
property
bool
sizeChanged
:
false
property
int
newEnd
:
-
1
property
int
oldMouseX
acceptedButtons
:
Qt
.
LeftButton
cursorShape
:
Qt
.
SizeHorCursor
drag.target
:
rightend
drag.axis
:
Drag
.
XAxis
...
...
@@ -1536,7 +1535,7 @@ Rectangle {
onPressed
:
{
root
.
autoScrolling
=
false
anchors
.
right
=
undefined
//rightend.
anchors.right = undefined
oldMouseX
=
mouseX
}
...
...
@@ -1545,13 +1544,13 @@ Rectangle {
newEnd
=
Math
.
round
((
mouseX
+
width
)
/
timeScale
)
if
(
mouseX
!=
oldMouseX
)
{
sizeChanged
=
true
duration
=
duration
+
(
mouseX
-
oldMouseX
)
/
timeScale
duration
=
subtitleBase
.
width
+
(
mouseX
-
oldMouseX
)
/
timeScale
}
}
}
onReleased
:
{
root
.
autoScrolling
=
timeline
.
autoScroll
//
anchors.right =
parent
.right
rightend
.
anchors
.
right
=
subtitleBase
.
right
if
(
mouseX
!=
oldMouseX
||
sizeChanged
)
{
timeline
.
editSubtitle
(
subtitleBase
.
x
/
timeline
.
scaleFactor
,
subtitleEdit
.
displayText
,
newEnd
)
}
...
...
Write
Preview
Markdown
is supported
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