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
eaea42c6
Commit
eaea42c6
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
b221dba5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/timeline.qml
View file @
eaea42c6
...
...
@@ -263,13 +263,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
;
...
...
@@ -1433,6 +1438,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 @
eaea42c6
...
...
@@ -483,6 +483,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
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