diff --git a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml index 2f7ee71a5f..e53932a9f9 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml @@ -32,31 +32,40 @@ Prop.PropGroup { property var showSubs: true property var jobEnabled: true + property var toggleJobActivation: function() { + console.log("the button has been pressed and jobEnabled is " + jobEnabled ) + jobEnabled = !jobEnabled; + rootConfig.getConfig(jobPath).enabled = jobEnabled; + } + // Panel Header Data Component panelHeaderData: Component { Item { id: header Prop.PropLabel { text: root.label - horizontalAlignment: Text.AlignHCenter + //horizontalAlignment: Text.AlignHCenter anchors.left: parent.left anchors.right: enabledIcon.left anchors.verticalCenter: parent.verticalCenter - } + } Prop.PropCanvasIcon { id: enabledIcon + anchors.right: enabledIcon2.left + anchors.verticalCenter: parent.verticalCenter + filled: root.jobEnabled + fillColor: (root.jobEnabled ? global.colorGreenHighlight : global.colorOrangeAccent) + icon: 5 + iconMouseArea.onClicked: { toggleJobActivation() } + } + Prop.PropCanvasIcon { + id: enabledIcon2 anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - fillColor: global.colorOrangeAccent - filled: jobEnabled - - MouseArea{ - id: mousearea - anchors.fill: parent - onClicked: { - root.jobEnabled = !root.jobEnabled - } - } + filled: root.jobEnabled + fillColor: (root.jobEnabled ? global.colorGreenHighlight : global.colorOrangeAccent) + icon: 7 + iconMouseArea.onClicked: { toggleJobActivation() } } } } diff --git a/scripts/developer/utilities/lib/prop/PropGroup.qml b/scripts/developer/utilities/lib/prop/PropGroup.qml index 6836e85e25..38f19389aa 100644 --- a/scripts/developer/utilities/lib/prop/PropGroup.qml +++ b/scripts/developer/utilities/lib/prop/PropGroup.qml @@ -63,14 +63,7 @@ Item { anchors.verticalCenter: parent.verticalCenter fillColor: global.colorOrangeAccent filled: root.propItemsPanel.height > 4 - - MouseArea{ - id: mousearea - anchors.fill: parent - onClicked: { - root.isUnfold = !root.isUnfold - } - } + iconMouseArea.onClicked: { root.isUnfold = !root.isUnfold } } } diff --git a/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml b/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml index b8e80f1c3b..3feed342b8 100644 --- a/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml +++ b/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml @@ -18,39 +18,85 @@ Canvas { height: global.iconHeight property var icon: 0 + + onIconChanged: function () { //console.log("Icon changed to: " + icon ); + requestPaint() + } + property var filled: true - onIconChanged: function () { requestPaint() } + onFilledChanged: function () { //console.log("Filled changed to: " + filled ); + requestPaint() + } + property var fillColor: global.colorBorderHighight + onFillColorChanged: function () { //console.log("fillColor changed to: " + filled ); + requestPaint() + } + + property alias iconMouseArea: mousearea contextType: "2d" onPaint: { context.reset(); switch (icon) { - case 0: - case 1: - case 2: - default: { - if ((icon % 3) == 0) { + case false: + case 0:{ // Right Arrow context.moveTo(width * 0.25, 0); context.lineTo(width * 0.25, height); context.lineTo(width, height / 2); - } else if ((icon % 3) == 1) { + context.closePath(); + } break; + case true: + case 1:{ // Up Arrow context.moveTo(0, height * 0.25); context.lineTo(width, height * 0.25); context.lineTo(width / 2, height); - } else { + context.closePath(); + } break; + case 2:{ // Down Arrow context.moveTo(0, height * 0.75); context.lineTo(width, height* 0.75); context.lineTo(width / 2, 0); + context.closePath(); + } break; + case 3:{ // Left Arrow + context.moveTo(width * 0.75, 0); + context.lineTo(width * 0.75, height); + context.lineTo(0, height / 2); + context.closePath(); + } break; + case 4:{ // Square + context.moveTo(0,0); + context.lineTo(0, height); + context.lineTo(width, height); + context.lineTo(width, 0); + context.closePath(); + } break; + case 5:{ // Small Square + context.moveTo(width * 0.25, height * 0.25); + context.lineTo(width * 0.25, height * 0.75); + context.lineTo(width * 0.75, height * 0.75); + context.lineTo(width * 0.75, height * 0.25); + context.closePath(); + } break; + default: {// Down Arrow + /* context.moveTo(0, height * 0.25); + context.lineTo(width, height * 0.25); + context.lineTo(width / 2, height); + context.closePath();*/ } - context.closePath(); - if (filled) { - context.fillStyle = fillColor; - context.fill(); - } else { - context.strokeStyle = fillColor; - context.stroke(); - } - }} + } + if (filled) { + context.fillStyle = fillColor; + context.fill(); + } else { + context.strokeStyle = fillColor; + context.stroke(); + } + } + + MouseArea{ + id: mousearea + anchors.fill: parent } } \ No newline at end of file