Move track thumbnails config in track header context menu

Change icon if track effects, and make it enable/disable effects
parent dff96367
......@@ -92,6 +92,9 @@ Rectangle {
onPressed: {
parent.clicked()
if (mouse.button == Qt.RightButton) {
headerMenu.trackId = trackId
headerMenu.thumbsFormat = thumbsFormat
headerMenu.audioTrack = trackHeadRoot.isAudio
headerMenu.popup()
}
}
......@@ -206,70 +209,15 @@ Rectangle {
Layout.fillHeight: true
}
ToolButton {
iconName: 'kdenlive-track_has_effect'
//checkable: true
//checked: trackHeadRoot.isStackEnabled
visible: trackHeadRoot.effectNames != ''
iconName: 'tools-wizard'
checkable: true
enabled: trackHeadRoot.effectNames != ''
checked: enabled && trackHeadRoot.isStackEnabled
implicitHeight: trackHeadRoot.iconSize
implicitWidth: trackHeadRoot.iconSize
onClicked: timeline.showTrackAsset(trackId)
//onClicked: controller.setTrackStackEnabled(trackId, !isStackEnabled)
}
ToolButton {
id: thumbsButton
visible: !isAudio
implicitHeight: trackHeadRoot.iconSize
implicitWidth: trackHeadRoot.iconSize
iconName: 'view-preview'
onClicked: thumbsContextMenu.popup()
Menu {
id: thumbsContextMenu
ExclusiveGroup { id: thumbStyle }
MenuItem {
text: "In frame"
id: inFrame
onTriggered:controller.setTrackProperty(trackId, "kdenlive:thumbs_format", 2)
checkable: true
exclusiveGroup: thumbStyle
}
MenuItem {
text: "In / out frames"
id: inOutFrame
onTriggered:controller.setTrackProperty(trackId, "kdenlive:thumbs_format", 0)
checkable: true
checked: true
exclusiveGroup: thumbStyle
}
MenuItem {
text: "All frames"
id: allFrame
onTriggered:controller.setTrackProperty(trackId, "kdenlive:thumbs_format", 1)
checkable: true
exclusiveGroup: thumbStyle
}
MenuItem {
text: "No thumbnails"
id: noFrame
onTriggered:controller.setTrackProperty(trackId, "kdenlive:thumbs_format", 3)
checkable: true
exclusiveGroup: thumbStyle
}
onAboutToShow: {
switch(thumbsFormat) {
case 3:
noFrame.checked = true
break
case 2:
inFrame.checked = true
break
case 1:
allFrame.checked = true
break
default:
inOutFrame.checked = true
break
}
}
onClicked: {
timeline.showTrackAsset(trackId)
controller.setTrackStackEnabled(trackId, !isStackEnabled)
}
}
ToolButton {
......
......@@ -485,6 +485,9 @@ Rectangle {
}
OLD.Menu {
id: headerMenu
property int trackId: -1
property int thumbsFormat: 0
property bool audioTrack: false
OLD.MenuItem {
text: i18n('Add Track')
onTriggered: {
......@@ -499,6 +502,56 @@ Rectangle {
timeline.ungrabHack()
}
}
OLD.Menu {
title: i18n('Track thumbnails')
visible: !headerMenu.audioTrack
OLD.ExclusiveGroup { id: thumbStyle }
OLD.MenuItem {
text: "In frame"
id: inFrame
onTriggered:controller.setTrackProperty(headerMenu.trackId, "kdenlive:thumbs_format", 2)
checkable: true
exclusiveGroup: thumbStyle
}
OLD.MenuItem {
text: "In / out frames"
id: inOutFrame
onTriggered:controller.setTrackProperty(headerMenu.trackId, "kdenlive:thumbs_format", 0)
checkable: true
checked: true
exclusiveGroup: thumbStyle
}
OLD.MenuItem {
text: "All frames"
id: allFrame
onTriggered:controller.setTrackProperty(headerMenu.trackId, "kdenlive:thumbs_format", 1)
checkable: true
exclusiveGroup: thumbStyle
}
OLD.MenuItem {
text: "No thumbnails"
id: noFrame
onTriggered:controller.setTrackProperty(headerMenu.trackId, "kdenlive:thumbs_format", 3)
checkable: true
exclusiveGroup: thumbStyle
}
onAboutToShow: {
switch(headerMenu.thumbsFormat) {
case 3:
noFrame.checked = true
break
case 2:
inFrame.checked = true
break
case 1:
allFrame.checked = true
break
default:
inOutFrame.checked = true
break
}
}
}
}
Row {
......
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