Skip to content
GitLab
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
67bf1b11
Commit
67bf1b11
authored
Jan 30, 2020
by
Jean-Baptiste Mardelle
Browse files
Switch timeline from ScrollView to Flickable
parent
85c60be8
Pipeline
#14181
passed with stage
in 15 minutes and 18 seconds
Changes
6
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/Clip.qml
View file @
67bf1b11
...
...
@@ -72,7 +72,7 @@ Rectangle {
property
bool
isComposition
:
false
property
bool
hideClipViews
:
false
property
var
groupTrimData
property
int
scrollStart
:
scrollView
.
contentItem
.
contentX
-
(
clipRoot
.
modelStart
*
timeline
.
scaleFactor
)
property
int
scrollStart
:
scrollView
.
contentX
-
(
clipRoot
.
modelStart
*
timeline
.
scaleFactor
)
width
:
clipDuration
*
timeScale
opacity
:
dragProxyArea
.
drag
.
active
&&
dragProxy
.
draggedItem
==
clipId
?
0.8
:
1.0
...
...
src/timeline2/view/qml/Composition.qml
View file @
67bf1b11
...
...
@@ -62,7 +62,7 @@ Item {
property
color
color
:
displayRect
.
color
property
color
borderColor
:
'
black
'
property
bool
hideCompoViews
property
int
scrollStart
:
scrollView
.
contentItem
.
contentX
-
modelStart
*
timeline
.
scaleFactor
property
int
scrollStart
:
scrollView
.
contentX
-
modelStart
*
timeline
.
scaleFactor
signal
moved
(
var
clip
)
signal
dragged
(
var
clip
,
var
mouse
)
...
...
src/timeline2/view/qml/Ruler.qml
View file @
67bf1b11
...
...
@@ -101,7 +101,7 @@ Rectangle {
Repeater
{
id
:
tickRepeater
model
:
scrollView
.
width
/
rulerRoot
.
tickSpacing
+
2
property
int
offset
:
Math
.
floor
(
scrollView
.
contentItem
.
contentX
/
rulerRoot
.
tickSpacing
)
property
int
offset
:
Math
.
floor
(
scrollView
.
contentX
/
rulerRoot
.
tickSpacing
)
Item
{
property
int
realPos
:
(
tickRepeater
.
offset
+
index
)
*
rulerRoot
.
tickSpacing
/
timeline
.
scaleFactor
x
:
realPos
*
timeline
.
scaleFactor
...
...
src/timeline2/view/qml/Timeline.js
View file @
67bf1b11
...
...
@@ -19,12 +19,12 @@
function
scrollIfNeeded
()
{
if
(
!
scrollView
)
return
;
var
x
=
root
.
consumerPosition
*
timeline
.
scaleFactor
;
if
(
x
>
scrollView
.
contentItem
.
contentX
+
scrollView
.
width
-
50
)
scrollView
.
contentItem
.
contentX
=
x
-
scrollView
.
width
+
50
;
if
(
x
>
scrollView
.
contentX
+
scrollView
.
width
-
50
)
scrollView
.
contentX
=
x
-
scrollView
.
width
+
50
;
else
if
(
x
<
50
)
scrollView
.
contentItem
.
contentX
=
0
;
else
if
(
x
<
scrollView
.
contentItem
.
contentX
+
50
)
scrollView
.
contentItem
.
contentX
=
x
-
50
;
scrollView
.
contentX
=
0
;
else
if
(
x
<
scrollView
.
contentX
+
50
)
scrollView
.
contentX
=
x
-
50
;
}
function
getTrackIndexFromPos
(
pos
)
{
...
...
@@ -49,7 +49,7 @@ function getTrackIdFromPos(pos) {
}
function
getTrackYFromId
(
id
)
{
var
result
=
-
scrollView
.
contentItem
.
contentY
var
result
=
-
scrollView
.
contentY
for
(
var
i
=
0
;
i
<
trackHeaderRepeater
.
count
;
i
++
)
{
if
(
trackHeaderRepeater
.
itemAt
(
i
).
trackId
==
id
)
{
break
;
...
...
@@ -83,7 +83,7 @@ function getTrackYFromMltIndex(id) {
if
(
id
<=
0
)
{
return
0
}
var
result
=
-
scrollView
.
contentItem
.
contentY
var
result
=
-
scrollView
.
contentY
for
(
var
i
=
0
;
i
<
trackHeaderRepeater
.
count
-
id
;
i
++
)
{
result
+=
trackHeaderRepeater
.
itemAt
(
i
).
height
}
...
...
@@ -107,7 +107,7 @@ function getTracksList() {
}
function
acceptDrop
(
xml
)
{
var
position
=
Math
.
round
((
dropTarget
.
x
+
scrollView
.
contentItem
.
contentX
-
headerWidth
)
/
timeline
.
scaleFactor
)
var
position
=
Math
.
round
((
dropTarget
.
x
+
scrollView
.
contentX
-
headerWidth
)
/
timeline
.
scaleFactor
)
timeline
.
insertClip
(
currentTrack
,
position
,
xml
)
/*if (timeline.ripple)
timeline.insert(currentTrack, position, xml)
...
...
src/timeline2/view/qml/Track.qml
View file @
67bf1b11
...
...
@@ -94,7 +94,7 @@ Item{
Binding
{
target
:
loader
.
item
property
:
"
scrollX
"
value
:
scrollView
.
contentItem
.
contentX
value
:
scrollView
.
contentX
when
:
loader
.
status
==
Loader
.
Ready
&&
loader
.
item
}
Binding
{
...
...
src/timeline2/view/qml/timeline.qml
View file @
67bf1b11
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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