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
851a68cb
Commit
851a68cb
authored
Mar 04, 2021
by
Julius Künzel
Browse files
Allow to edit title clip with double click on timeline
Fixes
#644
Inspired by Akhil Gangadharan and
!108
parent
5b5a368e
Pipeline
#53004
passed with stage
in 10 minutes and 31 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.h
View file @
851a68cb
...
...
@@ -438,6 +438,7 @@ public slots:
* @param minimumTracksCount the number of active streams for this clip
*/
void
checkProjectAudioTracks
(
QString
clipId
,
int
minimumTracksCount
);
void
showTitleWidget
(
const
std
::
shared_ptr
<
ProjectClip
>
&
clip
);
protected:
/* This function is called whenever an item is selected to propagate signals
...
...
@@ -527,7 +528,6 @@ private:
/** @brief Get the QModelIndex value for an item in the Bin. */
QModelIndex
getIndexForId
(
const
QString
&
id
,
bool
folderWanted
)
const
;
std
::
shared_ptr
<
ProjectClip
>
getFirstSelectedClip
();
void
showTitleWidget
(
const
std
::
shared_ptr
<
ProjectClip
>
&
clip
);
void
showSlideshowWidget
(
const
std
::
shared_ptr
<
ProjectClip
>
&
clip
);
void
processAudioThumbs
();
void
updateSortingAction
(
int
ix
);
...
...
src/timeline2/view/qml/timeline.qml
View file @
851a68cb
...
...
@@ -3,6 +3,7 @@ import QtQml.Models 2.11
import
QtQuick
.
Controls
2.4
import
Kdenlive
.
Controls
1.0
import
'
Timeline.js
'
as
Logic
import
com
.
enums
1.0
Rectangle
{
id
:
root
...
...
@@ -1633,7 +1634,11 @@ Rectangle {
}
else
{
clipBeingMovedId
=
-
1
timeline
.
ungrabHack
()
timeline
.
editItemDuration
(
dragProxy
.
draggedItem
)
if
(
dragProxy
.
masterObject
.
itemType
===
ProducerType
.
Text
||
dragProxy
.
masterObject
.
itemType
===
ProducerType
.
TextTemplate
)
{
timeline
.
editTitleClip
(
dragProxy
.
draggedItem
)
}
else
{
timeline
.
editItemDuration
(
dragProxy
.
draggedItem
)
}
}
}
}
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
851a68cb
...
...
@@ -3140,6 +3140,29 @@ void TimelineController::editItemDuration(int id)
}
}
void
TimelineController
::
editTitleClip
(
int
id
)
{
if
(
id
==
-
1
)
{
id
=
m_root
->
property
(
"mainItemId"
).
toInt
();
if
(
id
==
-
1
)
{
std
::
unordered_set
<
int
>
sel
=
m_model
->
getCurrentSelection
();
if
(
!
sel
.
empty
())
{
id
=
*
sel
.
begin
();
}
if
(
id
==
-
1
||
!
m_model
->
isItem
(
id
)
||
!
m_model
->
isClip
(
id
))
{
pCore
->
displayMessage
(
i18n
(
"No clip selected"
),
ErrorMessage
,
500
);
return
;
}
}
}
std
::
shared_ptr
<
ProjectClip
>
binClip
=
pCore
->
projectItemModel
()
->
getClipByBinID
(
getClipBinId
(
id
));
if
(
binClip
->
clipType
()
!=
ClipType
::
Text
&&
binClip
->
clipType
()
!=
ClipType
::
TextTemplate
)
{
pCore
->
displayMessage
(
i18n
(
"Item is not a title clip"
),
ErrorMessage
,
500
);
return
;
}
pCore
->
bin
()
->
showTitleWidget
(
binClip
);
}
QPoint
TimelineController
::
selectionInOut
()
const
{
std
::
unordered_set
<
int
>
ids
=
m_model
->
getCurrentSelection
();
...
...
src/timeline2/view/timelinecontroller.h
View file @
851a68cb
...
...
@@ -99,6 +99,9 @@ public:
/** @brief Edit an item's in/out points with a dialog
*/
Q_INVOKABLE
void
editItemDuration
(
int
itemId
=
-
1
);
/** @brief Edit a title clip with a title widget
*/
Q_INVOKABLE
void
editTitleClip
(
int
itemId
=
-
1
);
/** @brief Returns the topmost track containing a selected item (-1 if selection is embty) */
Q_INVOKABLE
int
selectedTrack
()
const
;
...
...
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