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
6b47852a
Commit
6b47852a
authored
Mar 23, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix timeline scrolling below zero and timeline drag/drop bug
parent
da75c7b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.cpp
View file @
6b47852a
...
...
@@ -700,6 +700,14 @@ void MyListView::mousePressEvent(QMouseEvent *event)
void
MyListView
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
if
((
event
->
buttons
()
&
Qt
::
LeftButton
)
!=
0u
&&
(
event
->
pos
()
-
m_startPos
).
manhattanLength
()
>
QApplication
::
startDragDistance
())
{
QModelIndexList
indexes
=
selectedIndexes
();
auto
*
drag
=
new
QDrag
(
this
);
drag
->
setMimeData
(
model
()
->
mimeData
(
indexes
));
drag
->
exec
();
emit
processDragEnd
();
return
;
}
QModelIndex
index
=
indexAt
(
event
->
pos
());
if
(
index
.
isValid
())
{
if
(
KdenliveSettings
::
hoverPreview
())
{
...
...
src/monitor/monitor.cpp
View file @
6b47852a
...
...
@@ -2365,6 +2365,7 @@ void Monitor::loadQmlScene(MonitorSceneType type, const QVariant &sceneData)
break
;
case
MonitorSceneDefault
:
QObject
::
connect
(
root
,
SIGNAL
(
editCurrentMarker
()),
this
,
SLOT
(
slotEditInlineMarker
()),
Qt
::
UniqueConnection
);
QObject
::
connect
(
root
,
SIGNAL
(
endDrag
()),
pCore
->
bin
(),
SIGNAL
(
processDragEnd
()),
Qt
::
UniqueConnection
);
m_qmlManager
->
setProperty
(
QStringLiteral
(
"timecode"
),
m_timePos
->
displayText
());
if
(
m_id
==
Kdenlive
::
ClipMonitor
)
{
updateQmlDisplay
(
KdenliveSettings
::
displayClipMonitorInfo
());
...
...
src/monitor/view/kdenliveclipmonitor.qml
View file @
6b47852a
...
...
@@ -69,6 +69,7 @@ Item {
}
signal
editCurrentMarker
()
signal
endDrag
()
function
updateScrolling
()
{
...
...
@@ -570,6 +571,12 @@ Item {
propagateComposedEvents
:
true
cursorShape
:
Qt
.
PointingHand
drag.target
:
parent
property
bool
dragActive
:
drag
.
active
onDragActiveChanged
:
{
if
(
!
drag
.
active
)
{
root
.
endDrag
()
}
}
onPressed
:
{
dragZone
.
uuid
=
controller
.
getUuid
()
}
...
...
@@ -595,6 +602,12 @@ Item {
propagateComposedEvents
:
true
cursorShape
:
Qt
.
PointingHand
drag.target
:
parent
property
bool
dragActive
:
drag
.
active
onDragActiveChanged
:
{
if
(
!
drag
.
active
)
{
root
.
endDrag
()
}
}
onPressed
:
{
dragZone
.
uuid
=
controller
.
getUuid
()
}
...
...
src/timeline2/view/qml/timeline.qml
View file @
6b47852a
...
...
@@ -170,7 +170,7 @@ Rectangle {
function
horizontalScroll
(
wheel
)
{
var
initialX
=
scrollView
.
contentX
if
(
wheel
.
angleDelta
.
y
<
0
)
{
scrollView
.
contentX
=
Math
.
min
(
scrollView
.
contentX
-
wheel
.
angleDelta
.
y
,
timeline
.
fullDuration
*
root
.
timeScale
-
scrollView
.
width
)
scrollView
.
contentX
=
Math
.
max
(
0
,
Math
.
min
(
scrollView
.
contentX
-
wheel
.
angleDelta
.
y
,
timeline
.
fullDuration
*
root
.
timeScale
-
scrollView
.
width
)
)
}
else
{
scrollView
.
contentX
=
Math
.
max
(
scrollView
.
contentX
-
wheel
.
angleDelta
.
y
,
0
)
}
...
...
@@ -191,7 +191,7 @@ Rectangle {
function
verticalScroll
(
wheel
)
{
if
(
wheel
.
angleDelta
.
y
<
0
)
{
scrollView
.
contentY
=
Math
.
min
(
scrollView
.
contentY
-
wheel
.
angleDelta
.
y
,
trackHeaders
.
height
+
subtitleTrackHeader
.
height
-
tracksArea
.
height
+
horZoomBar
.
height
+
ruler
.
height
)
scrollView
.
contentY
=
Math
.
max
(
0
,
Math
.
min
(
scrollView
.
contentY
-
wheel
.
angleDelta
.
y
,
trackHeaders
.
height
+
subtitleTrackHeader
.
height
-
tracksArea
.
height
+
horZoomBar
.
height
+
ruler
.
height
)
)
}
else
{
scrollView
.
contentY
=
Math
.
max
(
scrollView
.
contentY
-
wheel
.
angleDelta
.
y
,
0
)
}
...
...
@@ -680,7 +680,7 @@ Rectangle {
clearDropData
()
}
onEntered
:
{
if
(
clipBeingDroppedId
>
-
1
&&
lastDragUuid
!=
drag
.
getDataAsString
(
'
kdenlive/dragid
'
))
{
if
(
clipBeingDroppedId
>
-
1
&&
lastDragUuid
!=
drag
.
getDataAsString
(
'
kdenlive/dragid
'
)
&&
timeline
.
exists
(
clipBeingDroppedId
)
)
{
// We are re-entering drop zone with another drag operation, ensure the previous drop operation is complete
processDrop
()
}
...
...
@@ -723,9 +723,13 @@ Rectangle {
// If we exit on top, remove clip
controller
.
requestItemDeletion
(
clipBeingDroppedId
,
false
)
clearDropData
()
}
else
{
}
else
if
(
clipBeingDroppedId
>
-
1
)
{
// Clip is dropped
processDrop
()
//console.log('Dragging on left side!!!!!!!!!!!!!!!!!!!!!!!!!!!')
var
moveData
=
controller
.
suggestClipMove
(
clipBeingDroppedId
,
fakeTrack
,
0
,
root
.
consumerPosition
,
root
.
snapping
)
fakeFrame
=
moveData
[
0
]
fakeTrack
=
moveData
[
1
]
timeline
.
activeTrack
=
fakeTrack
}
}
onPositionChanged
:
{
...
...
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