Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
259
Issues
259
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
3d952925
Commit
3d952925
authored
Oct 14, 2020
by
Sashmita Raghav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable subtitle clip movement by dragging clip across subtitle track
parent
17a9ef37
Pipeline
#37651
passed with stage
in 15 minutes and 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
1 deletion
+48
-1
src/timeline2/view/qml/timeline.qml
src/timeline2/view/qml/timeline.qml
+48
-1
No files found.
src/timeline2/view/qml/timeline.qml
View file @
3d952925
...
...
@@ -1491,6 +1491,53 @@ Rectangle {
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}*/
MouseArea
{
// Clip shifting
id
:
subtitleClipArea
anchors.fill
:
parent
hoverEnabled
:
true
enabled
:
true
property
int
newStart
:
-
1
property
int
diff
:
-
1
property
double
delta
:
-
1
property
double
originalDuration
:
-
1
property
double
oldDelta
:
0
acceptedButtons
:
Qt
.
LeftButton
cursorShape
:
(
pressed
?
Qt
.
ClosedHandCursor
:
Qt
.
PointingHandCursor
);
drag.target
:
subtitleBase
drag.axis
:
Drag
.
XAxis
onPressed
:
{
console
.
log
(
'
IT IS PRESSED
'
)
root
.
autoScrolling
=
false
oldStartX
=
mouseX
oldStartFrame
=
subtitleBase
.
x
originalDuration
=
subtitleBase
.
width
/
timeScale
console
.
log
(
"
originalDuration
"
,
originalDuration
)
}
onPositionChanged
:
{
if
(
pressed
)
{
newStart
=
Math
.
round
((
subtitleBase
.
x
+
(
mouseX
-
oldStartX
))
/
timeScale
)
if
(
mouseX
!=
oldStartX
)
{
diff
=
(
mouseX
-
oldStartX
)
/
timeScale
subtitleBase
.
x
=
subtitleBase
.
x
+
diff
delta
=
subtitleBase
.
x
/
timeline
.
scaleFactor
-
oldStartFrame
/
timeline
.
scaleFactor
var
diffDelta
=
delta
-
oldDelta
oldDelta
=
delta
subtitleBase
.
width
=
originalDuration
*
timeline
.
scaleFactor
}
}
}
onReleased
:
{
console
.
log
(
'
IT IS RELEASED
'
)
root
.
autoScrolling
=
timeline
.
autoScroll
if
(
mouseX
!=
oldStartX
&&
oldStartFrame
!=
subtitleBase
.
x
)
{
console
.
log
(
"
old start frame
"
,
oldStartFrame
/
timeline
.
scaleFactor
,
"
new frame afer shifting
"
,
oldStartFrame
/
timeline
.
scaleFactor
+
delta
)
timeline
.
shiftSubtitle
(
oldStartFrame
/
timeline
.
scaleFactor
,
subtitleBase
.
x
/
timeline
.
scaleFactor
,
subtitleBase
.
x
/
timeline
.
scaleFactor
+
duration
,
subtitleEdit
.
text
)
}
console
.
log
(
"
originalDuration after shifting
"
,
originalDuration
)
}
}
TextField
{
id
:
subtitleEdit
font
:
miniFont
...
...
@@ -1500,7 +1547,7 @@ Rectangle {
timeline
.
editSubtitle
(
subtitleBase
.
x
/
timeline
.
scaleFactor
,
subtitleEdit
.
displayText
,
(
subtitleBase
.
x
+
subtitleBase
.
width
)
/
timeline
.
scaleFactor
)
}
anchors.fill
:
parent
visible
:
t
rue
&&
text
!=
""
visible
:
t
ext
!=
""
&&
timeScale
>=
6
text
:
model
.
subtitle
height
:
subtitleBase
.
height
width
:
subtitleBase
.
width
...
...
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