From e7e9715e106949a7a2a7bd0c91b0d92d0f4fe633 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Mon, 15 Apr 2019 09:16:59 -0700 Subject: [PATCH] merging up --- .../utilities/lib/jet/qml/TaskPropView.qml | 47 +++++++++++-------- .../utilities/lib/prop/PropGroup.qml | 18 ++++--- .../utilities/lib/prop/style/Global.qml | 46 +++++++++--------- .../utilities/lib/prop/style/PiCanvasIcon.qml | 10 +++- scripts/developer/utilities/render/luci2.js | 21 ++++----- 5 files changed, 81 insertions(+), 61 deletions(-) diff --git a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml index af4cbb1c9a..be3cda66b3 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml @@ -27,33 +27,40 @@ Prop.PropGroup { property var jobPath: "" property alias label: root.label + property var showProps: true + property var showSubs: true + function populatePropItems() { var propsModel = [] var props = Jet.job_propKeys(rootConfig.getConfig(jobPath)); console.log(JSON.stringify(props)); - for (var p in props) { - propsModel.push({"object": rootConfig.getConfig(jobPath), "property":props[p] }) + if (showProps) { + for (var p in props) { + propsModel.push({"object": rootConfig.getConfig(jobPath), "property":props[p] }) + } + root.updatePropItems(propsModel); } - root.updatePropItems(propsModel); - - Jet.task_traverse(rootConfig.getConfig(jobPath), - function(job, depth, index) { - var component = Qt.createComponent("./TaskPropView.qml"); - component.createObject(root.propItemsPanel, { - "label": job.objectName, - "rootConfig": root.rootConfig, - "jobPath": root.jobPath + '.' + job.objectName - }) - /* var component = Qt.createComponent("../../prop/PropItem.qml"); - component.createObject(root.propItemsPanel, { - "label": root.jobPath + '.' + job.objectName + ' num=' + index, - })*/ - // propsModel.push({"type": "printLabel", "label": root.jobPath + '.' + job.objectName + ' num=' + index }) - - return (depth < 1); - }, 0) + if (showSubs) { + Jet.task_traverse(rootConfig.getConfig(jobPath), + function(job, depth, index) { + var component = Qt.createComponent("./TaskPropView.qml"); + component.createObject(root.propItemsPanel, { + "label": job.objectName, + "rootConfig": root.rootConfig, + "jobPath": root.jobPath + '.' + job.objectName, + "showProps": root.showProps, + "showSubs": root.showSubs + }) + /* var component = Qt.createComponent("../../prop/PropItem.qml"); + component.createObject(root.propItemsPanel, { + "label": root.jobPath + '.' + job.objectName + ' num=' + index, + })*/ + // propsModel.push({"type": "printLabel", "label": root.jobPath + '.' + job.objectName + ' num=' + index }) + return (depth < 1); + }, 0) + } } Component.onCompleted: { diff --git a/scripts/developer/utilities/lib/prop/PropGroup.qml b/scripts/developer/utilities/lib/prop/PropGroup.qml index f4b1ba02d6..4c37eecc80 100644 --- a/scripts/developer/utilities/lib/prop/PropGroup.qml +++ b/scripts/developer/utilities/lib/prop/PropGroup.qml @@ -18,7 +18,7 @@ Item { property alias isUnfold: headerFolderIcon.icon property alias propItemsPanel: propItemsContainer - property alias headerContainer: headerContainer + default property alias extHeader: headerContainer.data // Header Item Item { @@ -39,7 +39,9 @@ Item { id: headerFolderIcon anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - + fillColor: global.colorOrangeAccent + filled: root.propItemsPanel.height > 4 + MouseArea{ id: mousearea anchors.fill: parent @@ -80,6 +82,7 @@ Item { border.width: global.valueBorderWidth radius: global.valueBorderRadius + anchors.margins: 0 anchors.left: parent.left anchors.right: parent.right anchors.top: header.bottom @@ -87,9 +90,11 @@ Item { Column { id: propItemsContainer - // anchors.top: header.bottom anchors.left: parent.left - anchors.right: parent.right + anchors.right: parent.right + anchors.leftMargin: 0 + anchors.rightMargin: 0 + clip: true // Where the propItems are added @@ -97,8 +102,9 @@ Item { } height: header.height + isUnfold * propItemsContainer.height - anchors.leftMargin: global.horizontalMargin - anchors.rightMargin: global.horizontalMargin +// anchors.leftMargin: global.horizontalMargin +// anchors.rightMargin: global.horizontalMargin + anchors.margins: 0 anchors.left: parent.left anchors.right: parent.right diff --git a/scripts/developer/utilities/lib/prop/style/Global.qml b/scripts/developer/utilities/lib/prop/style/Global.qml index 6066a4f99b..e348338df1 100644 --- a/scripts/developer/utilities/lib/prop/style/Global.qml +++ b/scripts/developer/utilities/lib/prop/style/Global.qml @@ -18,32 +18,36 @@ Item { HifiConstants { id: hifi } id: root - property real lineHeight: 32 - property real slimHeight: 24 + readonly property real lineHeight: 32 + readonly property real slimHeight: 24 - property real horizontalMargin: 4 + readonly property real horizontalMargin: 4 - property var color: hifi.colors.baseGray - property var colorBackHighlight: hifi.colors.baseGrayHighlight - property var colorBorderLight: hifi.colors.lightGray - property var colorBorderHighight: hifi.colors.blueHighlight + readonly property color color: hifi.colors.baseGray + readonly property color colorBackHighlight: hifi.colors.baseGrayHighlight + readonly property color colorBorderLight: hifi.colors.lightGray + readonly property color colorBorderHighight: hifi.colors.blueHighlight - property real fontSize: 12 - property var fontFamily: "Raleway" - property var fontWeight: Font.DemiBold - property var fontColor: hifi.colors.faintGray + readonly property color colorOrangeAccent: "#FF6309" + readonly property color colorRedAccent: "#C62147" + readonly property color colorGreenHighlight: "#1ac567" - property var splitterRightWidthScale: 0.45 - property real splitterWidth: 8 + readonly property real fontSize: 12 + readonly property var fontFamily: "Raleway" + readonly property var fontWeight: Font.DemiBold + readonly property color fontColor: hifi.colors.faintGray - property real iconWidth: fontSize - property real iconHeight: fontSize + readonly property var splitterRightWidthScale: 0.45 + readonly property real splitterWidth: 8 + + readonly property real iconWidth: fontSize + readonly property real iconHeight: fontSize - property var labelTextAlign: Text.AlignRight - property var labelTextElide: Text.ElideMiddle + readonly property var labelTextAlign: Text.AlignRight + readonly property var labelTextElide: Text.ElideMiddle - property var valueAreaWidthScale: 0.3 * (1.0 - splitterRightWidthScale) - property var valueTextAlign: Text.AlignHCenter - property real valueBorderWidth: 1 - property real valueBorderRadius: 2 + readonly property var valueAreaWidthScale: 0.3 * (1.0 - splitterRightWidthScale) + readonly property var valueTextAlign: Text.AlignHCenter + readonly property real valueBorderWidth: 1 + readonly property real valueBorderRadius: 2 } \ No newline at end of file diff --git a/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml b/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml index 6a805ea4c6..b8e80f1c3b 100644 --- a/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml +++ b/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml @@ -18,6 +18,7 @@ Canvas { height: global.iconHeight property var icon: 0 + property var filled: true onIconChanged: function () { requestPaint() } property var fillColor: global.colorBorderHighight @@ -43,8 +44,13 @@ Canvas { context.lineTo(width / 2, 0); } context.closePath(); - context.fillStyle = fillColor; - context.fill(); + if (filled) { + context.fillStyle = fillColor; + context.fill(); + } else { + context.strokeStyle = fillColor; + context.stroke(); + } }} } } \ No newline at end of file diff --git a/scripts/developer/utilities/render/luci2.js b/scripts/developer/utilities/render/luci2.js index 4aea49a059..d6bb005795 100644 --- a/scripts/developer/utilities/render/luci2.js +++ b/scripts/developer/utilities/render/luci2.js @@ -1,13 +1,10 @@ -function openEngineTaskView() { +function openView() { // Set up the qml ui - var qml = Script.resolvePath('luci.qml'); - var window = new OverlayWindow({ - title: 'luci qml', - source: qml, - width: 300, - height: 400 - }); - window.setPosition(200, 50); - //window.closed.connect(function() { Script.stop(); }); - } - openEngineTaskView(); \ No newline at end of file + var window = Desktop.createWindow(Script.resolvePath('luci.qml'), { + title: this.title, + presentationMode: Desktop.PresentationMode.NATIVE, + size: {x: 300, y: 400} + }); + //window.closed.connect(function() { Script.stop(); }); +} +openView(); \ No newline at end of file