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
714e90d0
Commit
714e90d0
authored
Jan 05, 2021
by
Pistos Pi
Committed by
Jean-Baptiste Mardelle
Jan 06, 2021
Browse files
Refactor: DRY up some code
parent
2c6b5b18
Pipeline
#46616
passed with stage
in 10 minutes and 39 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/timeline.qml
View file @
714e90d0
...
...
@@ -105,28 +105,36 @@ Rectangle {
}
}
else
if
(
wheel
.
modifiers
&
Qt
.
ShiftModifier
)
{
if
(
scrollVertically
)
{
// Horizontal scroll
var
newScroll
=
Math
.
min
(
scrollView
.
contentX
-
wheel
.
angleDelta
.
y
,
timeline
.
fullDuration
*
root
.
timeScale
-
scrollView
.
width
)
scrollView
.
contentX
=
Math
.
max
(
newScroll
,
0
)
horizontalScroll
(
wheel
)
}
else
{
// Vertical scroll
var
newScroll
=
Math
.
min
(
scrollView
.
contentY
-
wheel
.
angleDelta
.
y
,
trackHeaders
.
height
-
tracksArea
.
height
+
horScroll
.
height
+
ruler
.
height
)
scrollView
.
contentY
=
Math
.
max
(
newScroll
,
0
)
verticalScroll
(
wheel
)
}
}
else
{
if
(
scrollVertically
)
{
// Vertical scroll
var
newScroll
=
Math
.
min
(
scrollView
.
contentY
-
wheel
.
angleDelta
.
y
,
trackHeaders
.
height
-
tracksArea
.
height
+
horScroll
.
height
+
ruler
.
height
)
scrollView
.
contentY
=
Math
.
max
(
newScroll
,
0
)
verticalScroll
(
wheel
)
}
else
{
// Horizontal scroll
var
newScroll
=
Math
.
min
(
scrollView
.
contentX
-
wheel
.
angleDelta
.
y
,
timeline
.
fullDuration
*
root
.
timeScale
-
scrollView
.
width
)
scrollView
.
contentX
=
Math
.
max
(
newScroll
,
0
)
horizontalScroll
(
wheel
)
}
}
wheel
.
accepted
=
true
}
function
horizontalScroll
(
wheel
)
{
var
newScroll
=
Math
.
min
(
scrollView
.
contentX
-
wheel
.
angleDelta
.
y
,
timeline
.
fullDuration
*
root
.
timeScale
-
scrollView
.
width
)
scrollView
.
contentX
=
Math
.
max
(
newScroll
,
0
)
}
function
verticalScroll
(
wheel
)
{
var
newScroll
=
Math
.
min
(
scrollView
.
contentY
-
wheel
.
angleDelta
.
y
,
trackHeaders
.
height
-
tracksArea
.
height
+
horScroll
.
height
+
ruler
.
height
)
scrollView
.
contentY
=
Math
.
max
(
newScroll
,
0
)
}
function
continuousScrolling
(
x
,
y
)
{
// This provides continuous scrolling at the left/right edges.
if
(
x
>
scrollView
.
contentX
+
scrollView
.
width
-
root
.
baseUnit
*
3
)
{
...
...
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