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
dd6f3078
Commit
dd6f3078
authored
Mar 31, 2020
by
Jean-Baptiste Mardelle
Browse files
Show/hide track should create an undo/redo entry
parent
93dd9b7c
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelineitemmodel.cpp
View file @
dd6f3078
...
@@ -449,6 +449,22 @@ void TimelineItemModel::setTrackName(int trackId, const QString &text)
...
@@ -449,6 +449,22 @@ void TimelineItemModel::setTrackName(int trackId, const QString &text)
PUSH_UNDO
(
undo_lambda
,
redo_lambda
,
i18n
(
"Edit item"
));
PUSH_UNDO
(
undo_lambda
,
redo_lambda
,
i18n
(
"Edit item"
));
}
}
void
TimelineItemModel
::
hideTrack
(
int
trackId
,
const
QString
state
)
{
QWriteLocker
locker
(
&
m_lock
);
QString
previousState
=
getTrackProperty
(
trackId
,
QStringLiteral
(
"hide"
)).
toString
();
Fun
undo_lambda
=
[
this
,
trackId
,
previousState
]()
{
setTrackProperty
(
trackId
,
QStringLiteral
(
"hide"
),
previousState
);
return
true
;
};
Fun
redo_lambda
=
[
this
,
trackId
,
state
]()
{
setTrackProperty
(
trackId
,
QStringLiteral
(
"hide"
),
state
);
return
true
;
};
redo_lambda
();
PUSH_UNDO
(
undo_lambda
,
redo_lambda
,
i18n
(
"Edit item"
));
}
void
TimelineItemModel
::
setTrackProperty
(
int
trackId
,
const
QString
&
name
,
const
QString
&
value
)
void
TimelineItemModel
::
setTrackProperty
(
int
trackId
,
const
QString
&
name
,
const
QString
&
value
)
{
{
std
::
shared_ptr
<
TrackModel
>
track
=
getTrackById
(
trackId
);
std
::
shared_ptr
<
TrackModel
>
track
=
getTrackById
(
trackId
);
...
...
src/timeline2/model/timelineitemmodel.hpp
View file @
dd6f3078
...
@@ -88,6 +88,7 @@ public:
...
@@ -88,6 +88,7 @@ public:
@param text is the new track name.
@param text is the new track name.
*/
*/
Q_INVOKABLE
void
setTrackName
(
int
trackId
,
const
QString
&
text
);
Q_INVOKABLE
void
setTrackName
(
int
trackId
,
const
QString
&
text
);
Q_INVOKABLE
void
hideTrack
(
int
trackId
,
const
QString
state
);
/** @brief returns the lower video track index in timeline.
/** @brief returns the lower video track index in timeline.
**/
**/
int
getFirstVideoTrackIndex
()
const
;
int
getFirstVideoTrackIndex
()
const
;
...
...
src/timeline2/view/qml/TrackHead.qml
View file @
dd6f3078
...
@@ -320,7 +320,7 @@ Rectangle {
...
@@ -320,7 +320,7 @@ Rectangle {
//icon.width: trackHeadRoot.iconSize
//icon.width: trackHeadRoot.iconSize
//icon.height: trackHeadRoot.iconSize
//icon.height: trackHeadRoot.iconSize
icon.name
:
isAudio
?
(
isDisabled
?
'
kdenlive-hide-audio
'
:
'
kdenlive-show-audio
'
)
:
(
isDisabled
?
'
kdenlive-hide-video
'
:
'
kdenlive-show-video
'
)
icon.name
:
isAudio
?
(
isDisabled
?
'
kdenlive-hide-audio
'
:
'
kdenlive-show-audio
'
)
:
(
isDisabled
?
'
kdenlive-hide-video
'
:
'
kdenlive-show-video
'
)
onClicked
:
controller
.
set
Track
Property
(
trackId
,
"
hide
"
,
isDisabled
?
(
isAudio
?
'
1
'
:
'
2
'
)
:
'
3
'
)
onClicked
:
controller
.
hide
Track
(
trackId
,
isDisabled
?
(
isAudio
?
'
1
'
:
'
2
'
)
:
'
3
'
)
ToolTip
{
ToolTip
{
visible
:
muteButton
.
hovered
visible
:
muteButton
.
hovered
font
:
miniFont
font
:
miniFont
...
...
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