merging up

This commit is contained in:
Sam Gateau 2019-04-15 09:16:59 -07:00
parent 9581f5c958
commit e7e9715e10
5 changed files with 81 additions and 61 deletions

View file

@ -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: {

View file

@ -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

View file

@ -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
}

View file

@ -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();
}
}}
}
}

View file

@ -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();
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();