Changeset View
Changeset View
Standalone View
Standalone View
src/monitor/view/kdenlivemonitoreffectscene.qml
Show All 22 Lines | 3 | Item { | |||
---|---|---|---|---|---|
23 | onOffsetxChanged: canvas.requestPaint() | 23 | onOffsetxChanged: canvas.requestPaint() | ||
24 | onOffsetyChanged: canvas.requestPaint() | 24 | onOffsetyChanged: canvas.requestPaint() | ||
25 | property bool iskeyframe | 25 | property bool iskeyframe | ||
26 | property int requestedKeyFrame | 26 | property int requestedKeyFrame | ||
27 | property var centerPoints: [] | 27 | property var centerPoints: [] | ||
28 | property var centerPointsTypes: [] | 28 | property var centerPointsTypes: [] | ||
29 | onCenterPointsChanged: canvas.requestPaint() | 29 | onCenterPointsChanged: canvas.requestPaint() | ||
30 | property bool showToolbar: false | 30 | property bool showToolbar: false | ||
31 | property bool showOpacity: false | ||||
32 | property bool showRotation: false | ||||
31 | signal effectChanged() | 33 | signal effectChanged() | ||
32 | signal centersChanged() | 34 | signal centersChanged() | ||
33 | signal addKeyframe() | 35 | signal addKeyframe() | ||
34 | signal seekToKeyframe() | 36 | signal seekToKeyframe() | ||
35 | signal toolBarChanged(bool doAccept) | 37 | signal toolBarChanged(bool doAccept) | ||
36 | onZoomChanged: { | 38 | onZoomChanged: { | ||
37 | effectToolBar.setZoom(root.zoom) | 39 | effectToolBar.setZoom(root.zoom) | ||
38 | } | 40 | } | ||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | |||||
133 | } | 135 | } | ||
134 | function substractPoints(p1, p2, f) | 136 | function substractPoints(p1, p2, f) | ||
135 | { | 137 | { | ||
136 | var x = (p1.x - p2.x) / f | 138 | var x = (p1.x - p2.x) / f | ||
137 | var y = (p1.y - p2.y) / f | 139 | var y = (p1.y - p2.y) / f | ||
138 | return Qt.point(x,y); | 140 | return Qt.point(x,y); | ||
139 | } | 141 | } | ||
140 | } | 142 | } | ||
143 | | ||||
144 | | ||||
141 | Rectangle { | 145 | Rectangle { | ||
142 | id: frame | 146 | id: frame | ||
143 | objectName: "referenceframe" | 147 | objectName: "referenceframe" | ||
144 | property color hoverColor: "#ff0000" | 148 | property color hoverColor: "#ff0000" | ||
145 | width: root.profile.x * root.scalex | 149 | width: root.profile.x * root.scalex | ||
146 | height: root.profile.y * root.scaley | 150 | height: root.profile.y * root.scaley | ||
147 | x: root.center.x - width / 2 - root.offsetx; | 151 | x: root.center.x - width / 2 - root.offsetx; | ||
148 | y: root.center.y - height / 2 - root.offsety; | 152 | y: root.center.y - height / 2 - root.offsety; | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 213 | EffectToolBar { | |||
211 | anchors { | 215 | anchors { | ||
212 | left: parent.left | 216 | left: parent.left | ||
213 | top: parent.top | 217 | top: parent.top | ||
214 | topMargin: 10 | 218 | topMargin: 10 | ||
215 | leftMargin: 10 | 219 | leftMargin: 10 | ||
216 | } | 220 | } | ||
217 | visible: root.showToolbar | 221 | visible: root.showToolbar | ||
218 | } | 222 | } | ||
223 | | ||||
219 | Rectangle { | 224 | Rectangle { | ||
220 | id: framerect | 225 | id: framerect | ||
221 | property color hoverColor: "#ffffff" | 226 | property color hoverColor: "#ffffff" | ||
222 | x: frame.x + root.framesize.x * root.scalex | 227 | x: frame.x + root.framesize.x * root.scalex | ||
223 | y: frame.y + root.framesize.y * root.scaley | 228 | y: frame.y + root.framesize.y * root.scaley | ||
224 | width: root.framesize.width * root.scalex | 229 | width: root.framesize.width * root.scalex | ||
225 | height: root.framesize.height * root.scaley | 230 | height: root.framesize.height * root.scaley | ||
226 | color: "transparent" | 231 | color: "transparent" | ||
▲ Show 20 Lines • Show All 278 Lines • ▼ Show 20 Line(s) | |||||
505 | } | 510 | } | ||
506 | Rectangle { | 511 | Rectangle { | ||
507 | anchors.centerIn: parent | 512 | anchors.centerIn: parent | ||
508 | width: root.iskeyframe ? effectsize.height * 1.5 : effectsize.height / 2 | 513 | width: root.iskeyframe ? effectsize.height * 1.5 : effectsize.height / 2 | ||
509 | height: 1 | 514 | height: 1 | ||
510 | color: framerect.hoverColor | 515 | color: framerect.hoverColor | ||
511 | } | 516 | } | ||
512 | } | 517 | } | ||
518 | | ||||
519 | Opacity { | ||||
520 | id: opacity | ||||
521 | signal opacityChanged(real value) | ||||
mardelle: The opacityChanged(real) should be defined in the root object (around line 38 of this file)… | |||||
522 | anchors { | ||||
523 | left: parent.left | ||||
524 | top: parent.top | ||||
525 | topMargin: 20 | ||||
526 | leftMargin: 10 | ||||
527 | } | ||||
528 | visible: root.showOpacity | ||||
529 | root.opacityChanged(value) | ||||
There is no reason to trigger th signal when creating the object. mardelle: There is no reason to trigger th signal when creating the object.
The root.opacityChanged… | |||||
530 | } | ||||
531 | | ||||
532 | Rotation { | ||||
533 | id: rotation | ||||
534 | signal angleChanged() | ||||
mardelle: Same remark as opacityChanged. Signal should be defined as root signal. | |||||
535 | anchors { | ||||
536 | left: parent.left | ||||
537 | top: parent.top | ||||
538 | topMargin: 30 | ||||
mardelle: Extra bracket, remove | |||||
539 | leftMargin: 10 | ||||
540 | } | ||||
541 | visible: root.showRotation | ||||
542 | root.angleChanged() | ||||
mardelle: remove | |||||
543 | } | ||||
513 | } | 544 | } |
The opacityChanged(real) should be defined in the root object (around line 38 of this file), and not as a child of the Opacity item.
Then, in the Opacity.qml file, you trigger the signal by calling:
root.opacityChanged(value)