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
3a36c4ac
Commit
3a36c4ac
authored
Apr 13, 2021
by
Jean-Baptiste Mardelle
Browse files
Fix various focus issues (related to
#859
)
Fix crash on insert space
parent
78f4cfea
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/timeline.qml
View file @
3a36c4ac
...
...
@@ -306,11 +306,14 @@ Rectangle {
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
,
'
, TKY:
'
,
Logic
.
getTrackYFromId
(
tk
))
dragProxy
.
sourceFrame
=
tentativeClip
.
modelStart
dragProxy
.
isComposition
=
tentativeClip
.
isComposition
console
.
log
(
'
missing item
'
,
tentativeClip
.
clipId
,
'
, COORDS:
'
,
tentativeClip
.
x
,
'
x
'
,
tentativeClip
.
y
,
'
, TK id:
'
,
tk
,
'
, TKY:
'
,
Logic
.
getTrackYFromId
(
tk
),
'
STARTFRM:
'
,
dragProxy
.
sourceFrame
)
}
else
{
console
.
log
(
'
item not found
'
)
if
(
dragProxy
.
draggedItem
>
-
1
)
{
endDrag
()
}
}
}
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
3a36c4ac
...
...
@@ -2105,7 +2105,21 @@ void TimelineController::insertSpace(int trackId, int frame)
pCore
->
displayMessage
(
i18n
(
"No clips found to insert space"
),
ErrorMessage
,
500
);
return
;
}
int
start
=
m_model
->
getItemPosition
(
cid
);
int
start
=
-
1
;
if
(
m_model
->
isGroup
(
cid
))
{
std
::
unordered_set
<
int
>
sub
=
m_model
->
m_groups
->
getLeaves
(
cid
);
cid
=
*
sub
.
cbegin
();
int
start
=
m_model
->
getItemPosition
(
cid
);
for
(
int
current_id
:
sub
)
{
int
st
=
m_model
->
getItemPosition
(
current_id
);
if
(
st
<
start
)
{
cid
=
current_id
;
start
=
st
;
}
}
}
else
{
start
=
m_model
->
getItemPosition
(
cid
);
}
requestSpacerEndOperation
(
cid
,
start
,
start
+
spaceDuration
,
affectAllTracks
?
-
1
:
trackId
);
}
...
...
@@ -2187,8 +2201,10 @@ void TimelineController::changeItemSpeed(int clipId, double speed)
}
QScopedPointer
<
SpeedDialog
>
d
(
new
SpeedDialog
(
QApplication
::
activeWindow
(),
std
::
abs
(
speed
),
duration
,
minSpeed
,
maxSpeed
,
speed
<
0
,
pitchCompensate
));
if
(
d
->
exec
()
!=
QDialog
::
Accepted
)
{
emit
regainFocus
();
return
;
}
emit
regainFocus
();
speed
=
d
->
getValue
();
pitchCompensate
=
d
->
getPitchCompensate
();
qDebug
()
<<
"requesting speed "
<<
speed
;
...
...
@@ -3158,6 +3174,7 @@ void TimelineController::editItemDuration(int id)
undo
();
}
}
emit
regainFocus
();
}
void
TimelineController
::
editTitleClip
(
int
id
)
...
...
@@ -4152,6 +4169,7 @@ void TimelineController::importSubtitle(const QString path)
}
subtitleModel
->
importSubtitle
(
view
.
subtitle_url
->
url
().
toLocalFile
(),
offset
,
true
);
}
emit
regainFocus
();
}
void
TimelineController
::
exportSubtitle
()
...
...
src/timeline2/view/timelinecontroller.h
View file @
3a36c4ac
...
...
@@ -753,6 +753,7 @@ signals:
void
effectZoneChanged
();
void
masterZonesChanged
();
Q_INVOKABLE
void
ungrabHack
();
void
regainFocus
();
};
#endif
src/timeline2/view/timelinewidget.cpp
View file @
3a36c4ac
...
...
@@ -68,6 +68,7 @@ TimelineWidget::TimelineWidget(QWidget *parent)
m_proxy
=
new
TimelineController
(
this
);
connect
(
m_proxy
,
&
TimelineController
::
zoneMoved
,
this
,
&
TimelineWidget
::
zoneMoved
);
connect
(
m_proxy
,
&
TimelineController
::
ungrabHack
,
this
,
&
TimelineWidget
::
slotUngrabHack
);
connect
(
m_proxy
,
&
TimelineController
::
regainFocus
,
this
,
&
TimelineWidget
::
regainFocus
,
Qt
::
DirectConnection
);
setResizeMode
(
QQuickWidget
::
SizeRootObjectToView
);
engine
()
->
addImageProvider
(
QStringLiteral
(
"thumbnail"
),
new
ThumbnailProvider
);
setVisible
(
false
);
...
...
@@ -445,6 +446,8 @@ void TimelineWidget::slotUngrabHack()
QTimer
::
singleShot
(
200
,
this
,
[
this
]()
{
rootObject
()
->
setProperty
(
"mainFrame"
,
-
1
);
});
QPoint
mousePos
=
mapFromGlobal
(
QCursor
::
pos
());
QMetaObject
::
invokeMethod
(
rootObject
(),
"regainFocus"
,
Qt
::
DirectConnection
,
Q_ARG
(
QVariant
,
mousePos
));
}
}
...
...
@@ -502,9 +505,10 @@ bool TimelineWidget::eventFilter(QObject *object, QEvent *event)
void
TimelineWidget
::
regainFocus
()
{
qDebug
()
<<
"=== REG FOCUS: "
<<
underMouse
();
if
(
underMouse
()
&&
rootObject
())
{
QPoint
mousePos
=
mapFromGlobal
(
QCursor
::
pos
());
QMetaObject
::
invokeMethod
(
rootObject
(),
"regainFocus"
,
Q_ARG
(
QVariant
,
mousePos
));
QMetaObject
::
invokeMethod
(
rootObject
(),
"regainFocus"
,
Qt
::
DirectConnection
,
Q_ARG
(
QVariant
,
mousePos
));
}
}
...
...
src/timeline2/view/timelinewidget.h
View file @
3a36c4ac
...
...
@@ -57,7 +57,6 @@ public:
void
setTimelineMenu
(
QMenu
*
clipMenu
,
QMenu
*
compositionMenu
,
QMenu
*
timelineMenu
,
QMenu
*
timelineRulerMenu
,
QMenu
*
guideMenu
,
QAction
*
editGuideAction
,
QMenu
*
headerMenu
,
QMenu
*
thumbsMenu
,
QMenu
*
subtitleClipMenu
);
bool
loading
;
void
connectSubtitleModel
(
bool
firstConnect
);
void
regainFocus
();
void
unsetModel
();
protected:
...
...
@@ -79,6 +78,7 @@ public slots:
void
endDrag
();
/** @brief Show menu to switch track target audio stream */
void
showTargetMenu
(
int
tid
=
-
1
);
void
regainFocus
();
private
slots
:
void
slotUngrabHack
();
...
...
src/ui/saveprofile_ui.ui
View file @
3a36c4ac
...
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
329
</width>
<height>
6
18
</height>
<height>
6
50
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -144,6 +144,9 @@
<property
name=
"text"
>
<string>
Parameters (see
<
a href=
"
https://www.mltframework.org/plugins/ConsumerAvformat/
">
MLT documentation
<
/a
>
)
</string>
</property>
<property
name=
"textFormat"
>
<enum>
Qt::RichText
</enum>
</property>
<property
name=
"openExternalLinks"
>
<bool>
true
</bool>
</property>
...
...
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