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,23 +27,30 @@ Prop.PropGroup {
property var jobPath: "" property var jobPath: ""
property alias label: root.label property alias label: root.label
property var showProps: true
property var showSubs: true
function populatePropItems() { function populatePropItems() {
var propsModel = [] var propsModel = []
var props = Jet.job_propKeys(rootConfig.getConfig(jobPath)); var props = Jet.job_propKeys(rootConfig.getConfig(jobPath));
console.log(JSON.stringify(props)); console.log(JSON.stringify(props));
if (showProps) {
for (var p in props) { for (var p in props) {
propsModel.push({"object": rootConfig.getConfig(jobPath), "property":props[p] }) propsModel.push({"object": rootConfig.getConfig(jobPath), "property":props[p] })
} }
root.updatePropItems(propsModel); root.updatePropItems(propsModel);
}
if (showSubs) {
Jet.task_traverse(rootConfig.getConfig(jobPath), Jet.task_traverse(rootConfig.getConfig(jobPath),
function(job, depth, index) { function(job, depth, index) {
var component = Qt.createComponent("./TaskPropView.qml"); var component = Qt.createComponent("./TaskPropView.qml");
component.createObject(root.propItemsPanel, { component.createObject(root.propItemsPanel, {
"label": job.objectName, "label": job.objectName,
"rootConfig": root.rootConfig, "rootConfig": root.rootConfig,
"jobPath": root.jobPath + '.' + job.objectName "jobPath": root.jobPath + '.' + job.objectName,
"showProps": root.showProps,
"showSubs": root.showSubs
}) })
/* var component = Qt.createComponent("../../prop/PropItem.qml"); /* var component = Qt.createComponent("../../prop/PropItem.qml");
component.createObject(root.propItemsPanel, { component.createObject(root.propItemsPanel, {
@ -53,7 +60,7 @@ Prop.PropGroup {
return (depth < 1); return (depth < 1);
}, 0) }, 0)
}
} }
Component.onCompleted: { Component.onCompleted: {

View file

@ -18,7 +18,7 @@ Item {
property alias isUnfold: headerFolderIcon.icon property alias isUnfold: headerFolderIcon.icon
property alias propItemsPanel: propItemsContainer property alias propItemsPanel: propItemsContainer
property alias headerContainer: headerContainer default property alias extHeader: headerContainer.data
// Header Item // Header Item
Item { Item {
@ -39,6 +39,8 @@ Item {
id: headerFolderIcon id: headerFolderIcon
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
fillColor: global.colorOrangeAccent
filled: root.propItemsPanel.height > 4
MouseArea{ MouseArea{
id: mousearea id: mousearea
@ -80,6 +82,7 @@ Item {
border.width: global.valueBorderWidth border.width: global.valueBorderWidth
radius: global.valueBorderRadius radius: global.valueBorderRadius
anchors.margins: 0
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: header.bottom anchors.top: header.bottom
@ -87,9 +90,11 @@ Item {
Column { Column {
id: propItemsContainer id: propItemsContainer
// anchors.top: header.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.leftMargin: 0
anchors.rightMargin: 0
clip: true clip: true
// Where the propItems are added // Where the propItems are added
@ -97,8 +102,9 @@ Item {
} }
height: header.height + isUnfold * propItemsContainer.height height: header.height + isUnfold * propItemsContainer.height
anchors.leftMargin: global.horizontalMargin // anchors.leftMargin: global.horizontalMargin
anchors.rightMargin: global.horizontalMargin // anchors.rightMargin: global.horizontalMargin
anchors.margins: 0
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right

View file

@ -18,32 +18,36 @@ Item {
HifiConstants { id: hifi } HifiConstants { id: hifi }
id: root id: root
property real lineHeight: 32 readonly property real lineHeight: 32
property real slimHeight: 24 readonly property real slimHeight: 24
property real horizontalMargin: 4 readonly property real horizontalMargin: 4
property var color: hifi.colors.baseGray readonly property color color: hifi.colors.baseGray
property var colorBackHighlight: hifi.colors.baseGrayHighlight readonly property color colorBackHighlight: hifi.colors.baseGrayHighlight
property var colorBorderLight: hifi.colors.lightGray readonly property color colorBorderLight: hifi.colors.lightGray
property var colorBorderHighight: hifi.colors.blueHighlight readonly property color colorBorderHighight: hifi.colors.blueHighlight
property real fontSize: 12 readonly property color colorOrangeAccent: "#FF6309"
property var fontFamily: "Raleway" readonly property color colorRedAccent: "#C62147"
property var fontWeight: Font.DemiBold readonly property color colorGreenHighlight: "#1ac567"
property var fontColor: hifi.colors.faintGray
property var splitterRightWidthScale: 0.45 readonly property real fontSize: 12
property real splitterWidth: 8 readonly property var fontFamily: "Raleway"
readonly property var fontWeight: Font.DemiBold
readonly property color fontColor: hifi.colors.faintGray
property real iconWidth: fontSize readonly property var splitterRightWidthScale: 0.45
property real iconHeight: fontSize readonly property real splitterWidth: 8
property var labelTextAlign: Text.AlignRight readonly property real iconWidth: fontSize
property var labelTextElide: Text.ElideMiddle readonly property real iconHeight: fontSize
property var valueAreaWidthScale: 0.3 * (1.0 - splitterRightWidthScale) readonly property var labelTextAlign: Text.AlignRight
property var valueTextAlign: Text.AlignHCenter readonly property var labelTextElide: Text.ElideMiddle
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 height: global.iconHeight
property var icon: 0 property var icon: 0
property var filled: true
onIconChanged: function () { requestPaint() } onIconChanged: function () { requestPaint() }
property var fillColor: global.colorBorderHighight property var fillColor: global.colorBorderHighight
@ -43,8 +44,13 @@ Canvas {
context.lineTo(width / 2, 0); context.lineTo(width / 2, 0);
} }
context.closePath(); context.closePath();
if (filled) {
context.fillStyle = fillColor; context.fillStyle = fillColor;
context.fill(); context.fill();
} else {
context.strokeStyle = fillColor;
context.stroke();
}
}} }}
} }
} }

View file

@ -1,13 +1,10 @@
function openEngineTaskView() { function openView() {
// Set up the qml ui // Set up the qml ui
var qml = Script.resolvePath('luci.qml'); var window = Desktop.createWindow(Script.resolvePath('luci.qml'), {
var window = new OverlayWindow({ title: this.title,
title: 'luci qml', presentationMode: Desktop.PresentationMode.NATIVE,
source: qml, size: {x: 300, y: 400}
width: 300,
height: 400
}); });
window.setPosition(200, 50);
//window.closed.connect(function() { Script.stop(); }); //window.closed.connect(function() { Script.stop(); });
} }
openEngineTaskView(); openView();