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
de46c150
Commit
de46c150
authored
Dec 16, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix timeline vertical scrolling too fast.
Fixes
#868
parent
7623b16b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
16 deletions
+21
-16
src/timeline2/view/qml/timeline.qml
src/timeline2/view/qml/timeline.qml
+21
-16
No files found.
src/timeline2/view/qml/timeline.qml
View file @
de46c150
...
...
@@ -118,25 +118,26 @@ Rectangle {
function
continuousScrolling
(
x
,
y
)
{
// This provides continuous scrolling at the left/right edges.
if
(
x
>
scrollView
.
contentX
+
scrollView
.
width
-
root
.
baseUnit
*
3
)
{
scrollTimer
.
horizontal
=
10
scrollTimer
.
horizontal
=
root
.
baseUnit
scrollTimer
.
start
()
}
else
if
(
x
<
50
)
{
scrollView
.
contentX
=
0
;
scrollTimer
.
horizontal
=
0
scrollTimer
.
stop
()
}
else
if
(
x
<
scrollView
.
contentX
+
root
.
baseUnit
*
3
)
{
scrollTimer
.
horizontal
=
-
10
scrollTimer
.
horizontal
=
-
root
.
baseUnit
scrollTimer
.
start
()
}
else
{
if
(
y
>
scrollView
.
contentY
+
scrollView
.
height
+
ruler
.
height
-
root
.
baseUnit
*
3
)
{
scrollTimer
.
vertical
=
root
.
baseUnit
/
3
if
(
y
>
scrollView
.
contentY
+
scrollView
.
height
+
ruler
.
height
-
root
.
baseUnit
)
{
scrollTimer
.
vertical
=
root
.
baseUnit
scrollTimer
.
horizontal
=
0
scrollTimer
.
start
()
}
else
if
(
y
-
scrollView
.
contentY
-
ruler
.
height
<
root
.
baseUnit
*
3
)
{
scrollTimer
.
vertical
=
-
root
.
baseUnit
/
3
}
else
if
(
scrollView
.
contentY
>
0
&&
(
y
-
(
scrollView
.
contentY
+
ruler
.
height
)
<
root
.
baseUnit
)
)
{
scrollTimer
.
vertical
=
-
root
.
baseUnit
scrollTimer
.
horizontal
=
0
scrollTimer
.
start
()
}
else
{
console
.
log
(
'
TRIGGERING VERTICAL STOP:
'
,
y
,
'
, SCROLL:
'
,
scrollView
.
contentY
,
'
SCH:
'
,
scrollView
.
height
)
scrollTimer
.
vertical
=
0
scrollTimer
.
horizontal
=
0
scrollTimer
.
stop
()
...
...
@@ -345,10 +346,10 @@ Rectangle {
onViewActiveTrackChanged
:
{
var
tk
=
Logic
.
getTrackById
(
timeline
.
activeTrack
)
if
(
tk
.
y
<
scrollView
.
contentY
)
{
scrollView
.
contentY
=
Math
.
max
(
0
,
tk
.
y
-
scrollView
.
height
/
3
)
}
else
if
(
tk
.
y
+
tk
.
height
>
scrollView
.
contentY
+
scrollView
.
height
)
{
var
newY
=
Math
.
min
(
trackHeaders
.
height
-
scrollView
.
height
+
scrollView
.
ScrollBar
.
horizontal
.
height
,
tk
.
y
-
scrollView
.
height
/
3
)
if
(
tk
.
y
+
subtitleTrack
.
height
<
scrollView
.
contentY
)
{
scrollView
.
contentY
=
Math
.
max
(
0
,
tk
.
y
+
subtitleTrack
.
height
)
}
else
if
(
tk
.
y
+
tk
.
height
+
subtitleTrack
.
height
>
scrollView
.
contentY
+
scrollView
.
height
)
{
var
newY
=
Math
.
min
(
trackHeaders
.
height
+
subtitleTrack
.
height
-
scrollView
.
height
+
scrollView
.
ScrollBar
.
horizontal
.
height
,
tk
.
y
+
tk
.
height
-
scrollView
.
height
+
subtitleTrack
.
height
)
if
(
newY
>=
0
)
{
scrollView
.
contentY
=
newY
}
...
...
@@ -1102,19 +1103,22 @@ Rectangle {
var
y
=
rubberSelect
.
y
-
ruler
.
height
+
scrollView
.
contentY
var
selectSubs
=
false
var
selectOnlySubs
=
false
var
selectionHeight
=
rubberSelect
.
height
if
(
showSubtitles
)
{
selectSubs
=
y
<
subtitleTrack
.
height
if
(
y
+
rubberSelect
.
height
>
subtitleTrack
.
height
)
{
var
bottomRubber
=
y
+
rubberSelect
.
height
if
(
bottomRubber
>
subtitleTrack
.
height
)
{
y
=
Math
.
max
(
0
,
y
-
subtitleTrack
.
height
)
selectionHeight
=
bottomRubber
-
subtitleTrack
.
height
}
else
{
y
-=
subtitleTrack
.
height
selectOnlySubs
=
true
}
}
var
topTrack
=
Logic
.
getTrackIndexFromPos
(
Math
.
max
(
0
,
y
))
var
bottomTrack
=
Logic
.
getTrackIndexFromPos
(
Math
.
max
(
0
,
y
)
+
rubberSelect
.
h
eight
)
var
bottomTrack
=
Logic
.
getTrackIndexFromPos
(
Math
.
max
(
0
,
y
)
+
selectionH
eight
)
// Check if bottom of rubber selection covers the last track compositions
var
selectBottomCompositions
=
((
y
+
rubberSelect
.
h
eight
)
-
Logic
.
getTrackYFromId
(
tracksRepeater
.
itemAt
(
bottomTrack
).
trackInternalId
)
-
scrollView
.
contentY
)
>
(
Logic
.
getTrackHeightByPos
(
bottomTrack
)
*
0.6
)
var
selectBottomCompositions
=
((
y
+
selectionH
eight
)
-
Logic
.
getTrackYFromId
(
tracksRepeater
.
itemAt
(
bottomTrack
).
trackInternalId
)
-
scrollView
.
contentY
)
>
(
Logic
.
getTrackHeightByPos
(
bottomTrack
)
*
0.6
)
if
(
bottomTrack
>=
topTrack
)
{
var
t
=
[]
if
(
!
selectOnlySubs
)
{
...
...
@@ -1367,7 +1371,7 @@ Rectangle {
return
}
if
(
dragProxy
.
draggedItem
>
-
1
&&
mouse
.
buttons
===
Qt
.
LeftButton
&&
(
controller
.
isClip
(
dragProxy
.
draggedItem
)
||
controller
.
isComposition
(
dragProxy
.
draggedItem
)))
{
continuousScrolling
(
mouse
.
x
+
parent
.
x
,
mouse
.
y
+
parent
.
y
)
continuousScrolling
(
mouse
.
x
+
parent
.
x
,
dragProxyArea
.
mouseY
+
parent
.
y
-
dragProxy
.
verticalOffset
+
ruler
.
height
+
subtitleTrack
.
height
)
snapping
=
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
?
0
:
root
.
snapping
moveItem
()
}
...
...
@@ -1439,6 +1443,7 @@ Rectangle {
timeline
.
showToolTip
()
//bubbleHelp.hide()
}
tracksArea
.
focus
=
true
}
onDoubleClicked
:
{
if
(
dragProxy
.
masterObject
.
keyframeModel
)
{
...
...
@@ -1674,7 +1679,7 @@ Rectangle {
// This provides continuous scrolling at the left/right edges.
Timer
{
id
:
scrollTimer
interval
:
25
interval
:
80
repeat
:
true
triggeredOnStart
:
true
property
int
horizontal
:
0
...
...
@@ -1691,7 +1696,7 @@ Rectangle {
vertical
=
0
stop
()
}
else
{
var
maxScroll
=
trackHeaders
.
height
-
tracksArea
.
height
+
horScroll
.
height
+
ruler
.
height
var
maxScroll
=
trackHeaders
.
height
-
tracksArea
.
height
+
horScroll
.
height
+
ruler
.
height
+
subtitleTrack
.
height
if
(
scrollView
.
contentY
>
maxScroll
)
{
scrollView
.
contentY
=
Math
.
max
(
0
,
maxScroll
)
vertical
=
0
...
...
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