Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Cleanup UI track state (hidden/mute)

parent 3a4e564d
......@@ -182,8 +182,7 @@ QHash<int, QByteArray> TimelineItemModel::roleNames() const
roles[OutPointRole] = "out";
roles[FramerateRole] = "fps";
roles[GroupedRole] = "grouped";
roles[IsMuteRole] = "mute";
roles[IsHiddenRole] = "hidden";
roles[IsDisabledRole] = "disabled";
roles[IsAudioRole] = "audio";
roles[AudioLevelsRole] = "audioLevels";
roles[IsCompositeRole] = "composite";
......@@ -305,11 +304,9 @@ QVariant TimelineItemModel::data(const QModelIndex &index, int role) const
case DurationRole:
// qDebug() << "DATA yielding duration" << m_tractor->get_playtime();
return getTrackById_const(id)->trackDuration();
case IsMuteRole:
case IsDisabledRole:
// qDebug() << "DATA yielding mute" << 0;
return getTrackById_const(id)->isMute();
case IsHiddenRole:
return getTrackById_const(id)->isHidden();
return getTrackById_const(id)->isAudioTrack() ? getTrackById_const(id)->isMute() : getTrackById_const(id)->isHidden();
case IsAudioRole:
return getTrackById_const(id)->isAudioTrack();
case TrackTagRole:
......@@ -381,8 +378,7 @@ void TimelineItemModel::setTrackProperty(int trackId, const QString &name, const
} else if (name == QLatin1String("kdenlive:locked_track")) {
roles.push_back(IsLockedRole);
} else if (name == QLatin1String("hide")) {
roles.push_back(IsMuteRole);
roles.push_back(IsHiddenRole);
roles.push_back(IsDisabledRole);
}
if (!roles.isEmpty()) {
QModelIndex ix = makeTrackIndexFromID(trackId);
......
......@@ -120,8 +120,7 @@ public:
HasAudio, /// clip only
CanBeAudioRole, /// clip only
CanBeVideoRole, /// clip only
IsMuteRole, /// track only
IsHiddenRole, /// track only
IsDisabledRole, /// track only
IsAudioRole,
SortRole,
ShowKeyframesRole,
......
......@@ -24,9 +24,8 @@ import QtQuick.Layouts 1.3
Rectangle {
id: trackHeadRoot
property string trackName
property bool isMute
property bool isDisabled
property bool collapsed: false
property bool isHidden
property int isComposite
property bool isLocked
property bool isAudio
......@@ -174,7 +173,7 @@ Rectangle {
},
State {
name: 'mute'
when: trackHeadRoot.isMute || trackHeadRoot.isHidden
when: trackHeadRoot.isDisabled
PropertyChanges {
target: trackLed
color: 'orange'
......@@ -182,7 +181,7 @@ Rectangle {
},
State {
name: 'normalled'
when: !trackHeadRoot.isLocked && !trackHeadRoot.isMute && !trackHeadRoot.isHidden
when: !trackHeadRoot.isLocked && !trackHeadRoot.isDisabled
PropertyChanges {
target: trackLed
color: trackHeadRoot.selected ? 'green' : 'grey'
......@@ -207,25 +206,10 @@ Rectangle {
id: muteButton
implicitHeight: trackHeadRoot.iconSize
implicitWidth: trackHeadRoot.iconSize
visible: isAudio
iconName: isMute ? 'kdenlive-hide-audio' : 'kdenlive-show-audio'
iconSource: isMute ? 'qrc:///pics/kdenlive-hide-audio.svgz' : 'qrc:///pics/kdenlive-show-audio.svgz'
onClicked: controller.setTrackProperty(trackId, "hide", isMute ? isHidden ? '1' : '0' : isHidden ? '3' : '2')
tooltip: isMute? i18n('Unmute') : i18n('Mute')
}
ToolButton {
id: hideButton
implicitHeight: trackHeadRoot.iconSize
implicitWidth: trackHeadRoot.iconSize
visible: !isAudio
iconName: isHidden ? 'kdenlive-hide-video' : 'kdenlive-show-video'
iconSource: isHidden? 'qrc:///pics/kdenlive-hide-video.svgz' : 'qrc:///pics/kdenlive-show-video.svgz'
onClicked: {
controller.setTrackProperty(trackId, "hide", isHidden ? isMute ? '2' : '0' : isMute ? '3' : '1')
timeline.requestRefresh()
}
tooltip: isHidden? i18n('Show') : i18n('Hide')
iconName: isAudio ? (isDisabled ? 'kdenlive-hide-audio' : 'kdenlive-show-audio') : (isDisabled ? 'kdenlive-hide-video' : 'kdenlive-show-video')
iconSource: isAudio ? (isDisabled ? 'qrc:///pics/kdenlive-hide-audio.svgz' : 'qrc:///pics/kdenlive-show-audio.svgz') : (isDisabled ? 'qrc:///pics/kdenlive-hide-video.svgz' : 'qrc:///pics/kdenlive-show-video.svgz')
onClicked: controller.setTrackProperty(trackId, "hide", isDisabled ? (isAudio ? '1' : '2') : '3')
tooltip: isAudio ? (isDisabled? i18n('Unmute') : i18n('Mute')) : (isDisabled? i18n('Show') : i18n('Hide'))
}
ToolButton {
......
......@@ -468,8 +468,7 @@ Rectangle {
TrackHead {
trackName: model.name
trackTag: model.trackTag
isMute: model.mute
isHidden: model.hidden
isDisabled: model.disabled
isComposite: model.composite
isLocked: model.locked
isAudio: model.audio
......@@ -905,8 +904,6 @@ Rectangle {
timeScale: timeline.scaleFactor
width: tracksContainerArea.width
isAudio: audio
isMute: mute
isHidden: hidden
isCurrentTrack: item === timeline.activeTrack
trackId: item
onClipClicked: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment