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
68f7eaaa
Commit
68f7eaaa
authored
Oct 18, 2019
by
Jean-Baptiste Mardelle
Browse files
Make context menu "Extract" clearer (rename and add icon), and disable if no track is active
parent
5489327a
Pipeline
#9137
passed with stage
in 16 minutes and 46 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/ClipMenu.qml
View file @
68f7eaaa
...
...
@@ -11,6 +11,7 @@ Menu {
property
bool
grouped
property
bool
canBeAudio
property
bool
canBeVideo
property
bool
hasActiveTrack
property
bool
canBeGrouped
:
timeline
.
isInSelection
(
clipId
)
onAboutToHide
:
{
...
...
@@ -18,6 +19,7 @@ Menu {
}
onAboutToShow
:
{
canBeGrouped
=
timeline
.
isInSelection
(
clipId
)
hasActiveTrack
=
timeline
.
hasActiveTracks
()
}
MenuItem
{
...
...
@@ -105,8 +107,10 @@ Menu {
onTriggered
:
timeline
.
triggerAction
(
'
delete_timeline_clip
'
)
}
MenuItem
{
enabled
:
hasActiveTrack
visible
:
true
text
:
i18n
(
"
Extract
"
)
text
:
i18n
(
"
Extract Clip
"
)
iconName
:
'
timeline-extract
'
onTriggered
:
timeline
.
extract
(
clipId
)
}
MenuSeparator
{
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
68f7eaaa
...
...
@@ -2622,3 +2622,16 @@ void TimelineController::updateAudioTarget()
m_audioTargetActive
=
false
;
}
}
bool
TimelineController
::
hasActiveTracks
()
const
{
auto
it
=
m_model
->
m_allTracks
.
cbegin
();
while
(
it
!=
m_model
->
m_allTracks
.
cend
())
{
int
target_track
=
(
*
it
)
->
getId
();
if
(
m_model
->
getTrackById_const
(
target_track
)
->
shouldReceiveTimelineOp
())
{
return
true
;
}
++
it
;
}
return
false
;
}
src/timeline2/view/timelinecontroller.h
View file @
68f7eaaa
...
...
@@ -130,6 +130,10 @@ public:
*/
Q_INVOKABLE
void
showConfig
(
int
page
,
int
tab
);
/* @brief Returns true if we have at least one active track
*/
Q_INVOKABLE
bool
hasActiveTracks
()
const
;
/* @brief returns current timeline's zoom factor
*/
Q_INVOKABLE
double
scaleFactor
()
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