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
dff32d8e
Commit
dff32d8e
authored
Feb 27, 2021
by
Jean-Baptiste Mardelle
Browse files
When focusing the app, ensure we have the correct timeline item under mouse referenced.
Related to
#859
parent
1fbc6e7a
Pipeline
#52419
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/timeline.qml
View file @
dff32d8e
...
...
@@ -283,13 +283,18 @@ Rectangle {
dragProxy
.
verticalOffset
=
isComposition
?
itemObject
.
displayHeight
:
0
}
function
endDrag
()
{
console
.
log
(
'
ENDING DRAG!!!!!!!!!!!!!!!!!!!!!!
\n
'
)
dragProxy
.
draggedItem
=
-
1
dragProxy
.
x
=
0
dragProxy
.
y
=
0
//
dragProxy.x = 0
//
dragProxy.y = 0
dragProxy
.
width
=
0
dragProxy
.
height
=
0
dragProxy
.
verticalOffset
=
0
}
function
regainFocus
()
{
dragProxyArea
.
doRegainFocus
()
}
function
getAudioTracksCount
(){
var
audioCount
=
0
;
...
...
@@ -1535,6 +1540,28 @@ Rectangle {
moveItem
()
}
}
function
doRegainFocus
()
{
var
itemPos
=
mapToItem
(
tracksContainerArea
,
mouseX
,
mouseY
)
var
currentMouseTrack
=
Logic
.
getTrackIdFromPos
(
parent
.
y
+
mouseY
)
// Try to find correct item
var
tentativeClip
=
getItemAtPos
(
currentMouseTrack
,
itemPos
.
x
,
dragProxy
.
isComposition
)
if
(
tentativeClip
&&
tentativeClip
.
clipId
)
{
dragProxy
.
draggedItem
=
tentativeClip
.
clipId
var
tk
=
controller
.
getItemTrackId
(
tentativeClip
.
clipId
)
dragProxy
.
x
=
tentativeClip
.
x
dragProxy
.
y
=
tentativeClip
.
y
+
Logic
.
getTrackYFromId
(
tk
)
dragProxy
.
width
=
tentativeClip
.
width
dragProxy
.
height
=
tentativeClip
.
height
dragProxy
.
masterObject
=
tentativeClip
dragProxy
.
sourceTrack
=
tk
console
.
log
(
'
missing item
'
,
tentativeClip
.
clipId
,
'
, COORDS:
'
,
tentativeClip
.
x
,
'
x
'
,
tentativeClip
.
y
,
'
, TK id:
'
,
tk
)
dragProxy
.
sourceFrame
=
tentativeClip
.
modelStart
dragProxy
.
isComposition
=
tentativeClip
.
isComposition
}
else
{
console
.
log
(
'
item not found
'
)
}
}
function
moveItem
()
{
if
(
dragProxy
.
draggedItem
>
-
1
)
{
...
...
src/timeline2/view/timelinewidget.cpp
View file @
dff32d8e
...
...
@@ -484,6 +484,9 @@ bool TimelineWidget::eventFilter(QObject *object, QEvent *event)
emit
pCore
->
window
()
->
focusTimeline
(
false
,
false
);
break
;
case
QEvent
::
FocusIn
:
if
(
rootObject
())
{
QMetaObject
::
invokeMethod
(
rootObject
(),
"regainFocus"
);
}
emit
pCore
->
window
()
->
focusTimeline
(
true
,
false
);
break
;
default:
...
...
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