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 & fix composition resize

parent 74d8c520
......@@ -33,7 +33,6 @@ Rectangle {
property int inPoint: 0
property int outPoint: 0
property int clipDuration: 0
property bool isBlank: false
property bool isAudio: false
property bool isComposition: false
property bool grouped: false
......@@ -203,7 +202,6 @@ Rectangle {
Rectangle {
// text background
color: 'lightgray'
visible: !isBlank && !isComposition
opacity: 0.7
anchors.top: parent.top
anchors.left: parent.left
......@@ -217,7 +215,6 @@ Rectangle {
Text {
id: label
text: clipName
visible: !isBlank && !isComposition
font.pixelSize: root.baseUnit
anchors {
top: parent.top
......@@ -255,7 +252,6 @@ Rectangle {
Text {
id: mlabel
text: markers[2 * modelData + 1]
visible: !isBlank && !isComposition
font.pixelSize: root.baseUnit
x: markerBase.x
anchors {
......@@ -279,7 +275,7 @@ Rectangle {
},
State {
name: 'selectedBlank'
when: clipRoot.selected && clipRoot.isBlank
when: clipRoot.selected
PropertyChanges {
target: clipRoot
color: Qt.darker(getColor())
......@@ -299,7 +295,6 @@ Rectangle {
MouseArea {
id: mouseArea
anchors.fill: parent
enabled: !isBlank
acceptedButtons: Qt.LeftButton
drag.target: parent
drag.axis: Drag.XAxis
......@@ -341,8 +336,7 @@ Rectangle {
propagateComposedEvents: true
cursorShape: (trimInMouseArea.drag.active || trimOutMouseArea.drag.active)? Qt.SizeHorCursor :
(fadeInMouseArea.drag.active || fadeOutMouseArea.drag.active)? Qt.PointingHandCursor :
drag.active? Qt.ClosedHandCursor :
isBlank? Qt.ArrowCursor : Qt.OpenHandCursor
drag.active? Qt.ClosedHandCursor : Qt.OpenHandCursor
onPressed: {
root.stopScrolling = true
clipRoot.forceActiveFocus();
......@@ -356,7 +350,6 @@ Rectangle {
TimelineTriangle {
id: fadeInTriangle
visible: !isBlank && !isComposition
width: parent.fadeIn * timeScale
height: parent.height - parent.border.width * 2
anchors.left: parent.left
......@@ -366,7 +359,6 @@ Rectangle {
}
Rectangle {
id: fadeInControl
enabled: !isBlank && !isComposition
anchors.left: fadeInTriangle.width > radius? undefined : fadeInTriangle.left
anchors.horizontalCenter: fadeInTriangle.width > radius? fadeInTriangle.right : undefined
anchors.top: fadeInTriangle.top
......@@ -439,7 +431,6 @@ Rectangle {
TimelineTriangle {
id: fadeOutCanvas
visible: !isBlank && !isComposition
width: parent.fadeOut * timeScale
height: parent.height - parent.border.width * 2
anchors.right: parent.right
......@@ -450,7 +441,6 @@ Rectangle {
}
Rectangle {
id: fadeOutControl
enabled: !isBlank && !isComposition
anchors.right: fadeOutCanvas.width > radius? undefined : fadeOutCanvas.right
anchors.horizontalCenter: fadeOutCanvas.width > radius? fadeOutCanvas.left : undefined
anchors.top: fadeOutCanvas.top
......@@ -565,7 +555,6 @@ Rectangle {
}
Rectangle {
id: trimOut
enabled: !isBlank
anchors.right: parent.right
anchors.rightMargin: 0
height: parent.height
......@@ -610,7 +599,7 @@ Rectangle {
popup()
}
MenuItem {
visible: true // !isBlank && !isComposition
visible: true
text: i18n('Cut')
onTriggered: {
if (!trackRoot.isLocked) {
......@@ -633,27 +622,27 @@ Rectangle {
}
MenuItem {
visible: true //!isBlank && !isComposition
visible: true
text: i18n('Copy')
onTriggered: timeline.copyClip(trackIndex, index)
}
MenuSeparator {
visible: !isBlank && !isComposition
visible: true
}
MenuItem {
text: i18n('Remove')
onTriggered: timeline.triggerAction('delete_timeline_clip')
}
MenuItem {
visible: true //!isBlank
visible: true
text: i18n('Lift')
onTriggered: timeline.lift(trackIndex, index)
}
MenuSeparator {
visible: true //!isBlank && !isComposition
visible: true
}
MenuItem {
visible: true //!isBlank && !isComposition
visible: true
text: i18n('Split At Playhead (S)')
onTriggered: timeline.splitClip(trackIndex, index)
}
......@@ -663,7 +652,6 @@ Rectangle {
onTriggered: timeline.mergeClipWithNext(trackIndex, index, false)
}
MenuItem {
visible: !isBlank && !isComposition
text: i18n('Rebuild Audio Waveform')
onTriggered: timeline.remakeAudioLevels(trackIndex, index)
}
......
......@@ -36,7 +36,6 @@ Rectangle {
property int inPoint: 0
property int outPoint: 0
property int clipDuration: 0
property bool isBlank: false
property bool isAudio: false
property bool isComposition: true
property bool grouped: false
......@@ -55,6 +54,8 @@ Rectangle {
property bool selected: false
property double speed: 1.0
property color borderColor: 'black'
x: modelStart * timeScale
width : clipDuration * timeScale;
signal clicked(var clip, int shiftClick)
signal moved(var clip)
......@@ -66,17 +67,15 @@ Rectangle {
signal trimmingOut(var clip, real newDuration, var mouse)
signal trimmedOut(var clip)
onModelStartChanged: {
console.log("MODEL START CHANGED !!!!!!", modelStart, clipId, x);
x = modelStart * timeScale;
onTrackHeightChanged: {
a_trackPos = root.getTrackYFromId(a_track) - mapToItem(trackRoot, 0, 0).y - trackRoot.mapToItem(null, 0, 0).y + ruler.height
}
onTimeScaleChanged: {
console.log("SCALE CHANGED !!!!!!", timeScale)
x = modelStart * timeScale;
onClipDurationChanged: {
width = clipDuration * timeScale;
}
onTrackHeightChanged: {
a_trackPos = root.getTrackYFromId(a_track) - mapToItem(trackRoot, 0, 0).y - trackRoot.mapToItem(null, 0, 0).y + ruler.height
onTimeScaleChanged: {
width = clipDuration * timeScale;
}
SystemPalette { id: activePalette }
......@@ -163,14 +162,6 @@ Rectangle {
z: 0
}
},
State {
name: 'selectedBlank'
when: compositionRoot.selected && compositionRoot.isBlank
PropertyChanges {
target: compositionRoot
color: Qt.darker(getColor())
}
},
State {
name: 'selected'
when: compositionRoot.selected
......@@ -185,7 +176,6 @@ Rectangle {
MouseArea {
id: mouseArea
anchors.fill: parent
enabled: !isBlank
acceptedButtons: Qt.LeftButton
drag.target: parent
drag.axis: Drag.XAxis
......@@ -240,7 +230,6 @@ Rectangle {
Rectangle {
id: trimIn
enabled: !isBlank
anchors.left: parent.left
anchors.leftMargin: 0
height: parent.height
......@@ -286,7 +275,6 @@ Rectangle {
}
Rectangle {
id: trimOut
enabled: !isBlank
anchors.right: parent.right
anchors.rightMargin: 0
height: parent.height
......@@ -331,7 +319,6 @@ Rectangle {
popup()
}
MenuItem {
visible: true // !isBlank && !isComposition
text: i18n('Cut')
onTriggered: {
if (!trackRoot.isLocked) {
......@@ -354,27 +341,27 @@ Rectangle {
}
MenuItem {
visible: true //!isBlank && !isComposition
visible: true
text: i18n('Copy')
onTriggered: timeline.copyClip(trackIndex, index)
}
MenuSeparator {
visible: !isBlank && !isComposition
visible: !isComposition
}
MenuItem {
text: i18n('Remove')
onTriggered: timeline.triggerAction('delete_timeline_clip')
}
MenuItem {
visible: true //!isBlank
visible: true
text: i18n('Lift')
onTriggered: timeline.lift(trackIndex, index)
}
MenuSeparator {
visible: true //!isBlank && !isComposition
visible: true
}
MenuItem {
visible: true //!isBlank && !isComposition
visible: true
text: i18n('Split At Playhead (S)')
onTriggered: timeline.splitClip(trackIndex, index)
}
......@@ -384,7 +371,7 @@ Rectangle {
onTriggered: timeline.mergeClipWithNext(trackIndex, index, false)
}
MenuItem {
visible: !isBlank && !isComposition
visible: !isComposition
text: i18n('Rebuild Audio Waveform')
onTriggered: timeline.remakeAudioLevels(trackIndex, index)
}
......
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