From 3d78592bb84ddc417bfde7f8acb83e98dd32eaed Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Thu, 18 Apr 2019 00:19:19 -0700 Subject: [PATCH] Adding more style widgets andbringing luci1 into the panels of luci2 --- .../developer/utilities/lib/prop/PropBool.qml | 4 +- .../utilities/lib/prop/PropGroup.qml | 30 +++- scripts/developer/utilities/lib/prop/qmldir | 2 + .../utilities/lib/prop/style/PiCheckBox.qml | 25 ++++ .../lib/prop/style/PiFolderPanel.qml | 133 ++++++++++++++++++ .../utilities/render/deferredLighting.qml | 71 +--------- scripts/developer/utilities/render/luci.qml | 32 ++--- .../utilities/render/luci/ShadingModel.qml | 105 ++++++++++++++ .../developer/utilities/render/luci/qmldir | 2 + 9 files changed, 306 insertions(+), 98 deletions(-) create mode 100644 scripts/developer/utilities/lib/prop/style/PiCheckBox.qml create mode 100644 scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml create mode 100644 scripts/developer/utilities/render/luci/ShadingModel.qml create mode 100644 scripts/developer/utilities/render/luci/qmldir diff --git a/scripts/developer/utilities/lib/prop/PropBool.qml b/scripts/developer/utilities/lib/prop/PropBool.qml index d8e4bad589..1d50ec7dd3 100644 --- a/scripts/developer/utilities/lib/prop/PropBool.qml +++ b/scripts/developer/utilities/lib/prop/PropBool.qml @@ -9,7 +9,6 @@ // import QtQuick 2.7 -import controlsUit 1.0 as HifiControls PropItem { Global { id: global } @@ -21,13 +20,12 @@ PropItem { valueVar = root.valueVarGetter(); } - HifiControls.CheckBox { + PropCheckBox { id: checkboxControl anchors.left: root.splitter.right anchors.verticalCenter: root.verticalCenter width: root.width * global.valueAreaWidthScale - height: global.slimHeight onCheckedChanged: { root.valueVarSetter(checked); } } diff --git a/scripts/developer/utilities/lib/prop/PropGroup.qml b/scripts/developer/utilities/lib/prop/PropGroup.qml index 38f19389aa..2f15e60a0c 100644 --- a/scripts/developer/utilities/lib/prop/PropGroup.qml +++ b/scripts/developer/utilities/lib/prop/PropGroup.qml @@ -10,19 +10,35 @@ import QtQuick 2.7 -Item { +//Item { +PropFolderPanel { Global { id: global } id: root - property var label: "group" + // property var label: "group" - property alias isUnfold: headerFolderIcon.icon - property var indentDepth: 0 + // property alias isUnfold: headerFolderIcon.icon + // property var indentDepth: 0 - property alias propItemsPanel: propItemsContainer + //property alias propItemsPanel: _panelFrameData + // property alias propItemsPanel: propItemsContainer + //property var propItemsPanel: propItemsContainer + + panelFrameData: Component { // default is a column + id: groupPanelFrameData + Column { + id: propItemsContainer + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 0 + anchors.rightMargin: 0 + + clip: true + } + } // Panel Header Data Component - property Component panelHeaderData: defaultPanelHeaderData +/* property Component panelHeaderData: defaultPanelHeaderData Component { // default is a Label id: defaultPanelHeaderData PropLabel { @@ -110,7 +126,7 @@ Item { anchors.margins: 0 anchors.left: parent.left anchors.right: parent.right - +*/ // Prop Group is designed to author an array of ProItems, they are defined with an array of the tuplets describing each individual item: // [ ..., PropItemInfo, ...] diff --git a/scripts/developer/utilities/lib/prop/qmldir b/scripts/developer/utilities/lib/prop/qmldir index 2cd06d58ac..c67ab6a41a 100644 --- a/scripts/developer/utilities/lib/prop/qmldir +++ b/scripts/developer/utilities/lib/prop/qmldir @@ -5,6 +5,8 @@ PropLabel 1.0 style/PiLabel.qml PropSplitter 1.0 style/PiSplitter.qml PropComboBox 1.0 style/PiComboBox.qml PropCanvasIcon 1.0 style/PiCanvasIcon.qml +PropCheckBox 1.0 style/PiCheckBox.qml +PropFolderPanel 1.0 style/PiFolderPanel.qml PropItem 1.0 PropItem.qml PropScalar 1.0 PropScalar.qml diff --git a/scripts/developer/utilities/lib/prop/style/PiCheckBox.qml b/scripts/developer/utilities/lib/prop/style/PiCheckBox.qml new file mode 100644 index 0000000000..108a763be3 --- /dev/null +++ b/scripts/developer/utilities/lib/prop/style/PiCheckBox.qml @@ -0,0 +1,25 @@ +// +// Prop/style/PiCheckBox.qml +// +// Created by Sam Gateau on 3/2/2019 +// Copyright 2019 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html +// + +import QtQuick 2.7 +import controlsUit 1.0 as HifiControls + +HifiControls.CheckBox { + Global { id: global } + + color: global.fontColor + + //anchors.left: root.splitter.right + //anchors.verticalCenter: root.verticalCenter + //width: root.width * global.valueAreaWidthScale + height: global.slimHeight + + onCheckedChanged: { root.valueVarSetter(checked); } +} \ No newline at end of file diff --git a/scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml b/scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml new file mode 100644 index 0000000000..b80ab47fc6 --- /dev/null +++ b/scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml @@ -0,0 +1,133 @@ +// +// Prop/style/PiFoldedPanel.qml +// +// Created by Sam Gateau on 4/17/2019 +// Copyright 2019 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html +// + +import QtQuick 2.7 + +Item { + Global { id: global } + id: root + + property var label: "panel" + + property alias isUnfold: headerFolderIcon.icon + property var indentDepth: 0 + + // Panel Header Data Component + property Component panelHeaderData: defaultPanelHeaderData + Component { // default is a Label + id: defaultPanelHeaderData + PiLabel { + text: root.label + horizontalAlignment: Text.AlignHCenter + } + } + + // Panel Frame Data Component + property Component panelFrameData: defaultPanelFrameData + Component { // default is a column + id: defaultPanelFrameData + Column { + } + } + + //property alias panelFrameContent: frame._panelFrameData.data + + // Header Item + Rectangle { + id: header + height: global.slimHeight + anchors.left: parent.left + anchors.right: parent.right + + color: global.colorBackShadow // header of group is darker + + // First in the header, some indentation spacer + Item { + id: indentSpacer + width: (headerFolderIcon.width * root.indentDepth) + global.horizontalMargin // Must be non-zero + height: parent.height + + anchors.verticalCenter: parent.verticalCenter + } + + // Second, the folder button / indicator + Item { + id: headerFolder + anchors.left: indentSpacer.right + width: headerFolderIcon.width * 2 + anchors.verticalCenter: header.verticalCenter + height: parent.height + + PiCanvasIcon { + id: headerFolderIcon + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + fillColor: global.colorOrangeAccent + filled: root.frame.height > 4 + iconMouseArea.onClicked: { root.isUnfold = !root.isUnfold } + } + } + + // Next the header container + // by default containing a Label showing the root.label + Loader { + sourceComponent: panelHeaderData + anchors.left: headerFolder.right + anchors.right: header.right + anchors.verticalCenter: header.verticalCenter + height: parent.height + } + } + + // The Panel container + Rectangle { + id: frame + visible: root.isUnfold + + color: "transparent" + border.color: global.colorBorderLight + border.width: global.valueBorderWidth + radius: global.valueBorderRadius + + anchors.margins: 0 + anchors.left: parent.left + anchors.right: parent.right + anchors.top: header.bottom + anchors.bottom: root.bottom + + // Next the panel frame data + Loader { + sourceComponent: panelFrameData + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 0 + anchors.rightMargin: 0 + id: _panelFrameData + clip: true + } + + /* Column { + id: propItemsContainer + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 0 + anchors.rightMargin: 0 + + clip: true + + // Where the propItems are added + }*/ + } + + height: header.height + isUnfold * _panelFrameData.height + anchors.margins: 0 + anchors.left: parent.left + anchors.right: parent.right +} \ No newline at end of file diff --git a/scripts/developer/utilities/render/deferredLighting.qml b/scripts/developer/utilities/render/deferredLighting.qml index d147585212..63c2af1b0f 100644 --- a/scripts/developer/utilities/render/deferredLighting.qml +++ b/scripts/developer/utilities/render/deferredLighting.qml @@ -14,6 +14,7 @@ import QtQuick.Layouts 1.3 import stylesUit 1.0 import controlsUit 1.0 as HifiControls import "configSlider" +import "luci" Rectangle { HifiConstants { id: hifi;} @@ -32,76 +33,8 @@ Rectangle { HifiControls.Label { text: "Shading" } - Row { - anchors.left: parent.left - anchors.right: parent.right - - spacing: 5 - Column { - spacing: 5 - // padding: 10 - Repeater { - model: [ - "Unlit:LightingModel:enableUnlit", - "Emissive:LightingModel:enableEmissive", - "Lightmap:LightingModel:enableLightmap", - "Background:LightingModel:enableBackground", - "Haze:LightingModel:enableHaze", - "AO:LightingModel:enableAmbientOcclusion", - "Textures:LightingModel:enableMaterialTexturing" - ] - HifiControls.CheckBox { - boxSize: 20 - text: modelData.split(":")[0] - checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] - onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } - } - } - } + ShadingModel { - - Column { - spacing: 5 - Repeater { - model: [ - "Obscurance:LightingModel:enableObscurance", - "Scattering:LightingModel:enableScattering", - "Diffuse:LightingModel:enableDiffuse", - "Specular:LightingModel:enableSpecular", - "Albedo:LightingModel:enableAlbedo", - "Wireframe:LightingModel:enableWireframe", - "Skinning:LightingModel:enableSkinning", - "Blendshape:LightingModel:enableBlendshape" - ] - HifiControls.CheckBox { - boxSize: 20 - text: modelData.split(":")[0] - checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] - onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } - } - } - } - - Column { - spacing: 5 - Repeater { - model: [ - "Ambient:LightingModel:enableAmbientLight", - "Directional:LightingModel:enableDirectionalLight", - "Point:LightingModel:enablePointLight", - "Spot:LightingModel:enableSpotLight", - "Light Contour:LightingModel:showLightContour", - "Zone Stack:DrawZoneStack:enabled", - "Shadow:LightingModel:enableShadow" - ] - HifiControls.CheckBox { - boxSize: 20 - text: modelData.split(":")[0] - checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] - onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } - } - } - } } Separator {} Column { diff --git a/scripts/developer/utilities/render/luci.qml b/scripts/developer/utilities/render/luci.qml index 8c68d654a1..7bce087fda 100644 --- a/scripts/developer/utilities/render/luci.qml +++ b/scripts/developer/utilities/render/luci.qml @@ -15,6 +15,7 @@ import controlsUit 1.0 as HifiControls import "../lib/prop" as Prop import "../lib/jet/qml" as Jet +import "luci" Rectangle { anchors.fill: parent @@ -31,7 +32,14 @@ Rectangle { Column { width: render.width - + Prop.PropFolderPanel { + id: "shadingModel" + label: "Shading Model" + panelFrameData: Component { + ShadingModel { + } + } + } /* Prop.PropEnum { label: "Tone Curve" object: render.mainViewTask.getConfig("ToneMapping") @@ -45,14 +53,6 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right } */ - Jet.TaskPropView { - id: "lightingModel" - jobPath: "RenderMainView.LightingModel" - label: "Le LightingModel" - - anchors.left: parent.left - anchors.right: parent.right - } Jet.TaskPropView { id: "theView" jobPath: "RenderMainView" @@ -69,20 +69,14 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right } - /* Jet.TaskPropView { - jobPath: "RenderMainView.ToneMapping" - label: "Le ToneMapping Job" + Jet.TaskPropView { + id: "le" + jobPath: "" + label: "Le Render Engine" anchors.left: parent.left anchors.right: parent.right } - Jet.TaskPropView { - jobPath: "RenderMainView.Antialiasing" - label: "Le Antialiasing Job" - - anchors.left: parent.left - anchors.right: parent.right - }*/ } } diff --git a/scripts/developer/utilities/render/luci/ShadingModel.qml b/scripts/developer/utilities/render/luci/ShadingModel.qml new file mode 100644 index 0000000000..2c16492e80 --- /dev/null +++ b/scripts/developer/utilities/render/luci/ShadingModel.qml @@ -0,0 +1,105 @@ +// +// ShadingModel.qml +// +// Created by Sam Gateau on 4/17/2019 +// Copyright 2019 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html +// + +import QtQuick 2.7 + +import stylesUit 1.0 +import controlsUit 1.0 as HifiControls + +import QtQuick.Controls 1.4 +import QtQuick.Layouts 1.3 + +import stylesUit 1.0 +import controlsUit 1.0 as HifiControls + +import "../../lib/prop" as Prop + + +Column { + + id: shadingModel; + + property var mainViewTask: Render.getConfig("RenderMainView") + + spacing: 5 + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: hifi.dimensions.contentMargin.x + HifiControls.Label { + text: "Shading" + } + Row { + anchors.left: parent.left + anchors.right: parent.right + + spacing: 5 + Column { + spacing: 5 + Repeater { + model: [ + "Unlit:LightingModel:enableUnlit", + "Emissive:LightingModel:enableEmissive", + "Lightmap:LightingModel:enableLightmap", + "Background:LightingModel:enableBackground", + "Haze:LightingModel:enableHaze", + "AO:LightingModel:enableAmbientOcclusion", + "Textures:LightingModel:enableMaterialTexturing" + ] + Prop.PropCheckBox { + text: modelData.split(":")[0] + checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] + onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } + } + } + } + + + Column { + spacing: 5 + Repeater { + model: [ + "Obscurance:LightingModel:enableObscurance", + "Scattering:LightingModel:enableScattering", + "Diffuse:LightingModel:enableDiffuse", + "Specular:LightingModel:enableSpecular", + "Albedo:LightingModel:enableAlbedo", + "Wireframe:LightingModel:enableWireframe", + "Skinning:LightingModel:enableSkinning", + "Blendshape:LightingModel:enableBlendshape" + ] + Prop.PropCheckBox { + text: modelData.split(":")[0] + checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] + onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } + } + } + } + + Column { + spacing: 5 + Repeater { + model: [ + "Ambient:LightingModel:enableAmbientLight", + "Directional:LightingModel:enableDirectionalLight", + "Point:LightingModel:enablePointLight", + "Spot:LightingModel:enableSpotLight", + "Light Contour:LightingModel:showLightContour", + "Zone Stack:DrawZoneStack:enabled", + "Shadow:LightingModel:enableShadow" + ] + Prop.PropCheckBox { + text: modelData.split(":")[0] + checked: render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] + onCheckedChanged: { render.mainViewTask.getConfig(modelData.split(":")[1])[modelData.split(":")[2]] = checked } + } + } + } + } +} diff --git a/scripts/developer/utilities/render/luci/qmldir b/scripts/developer/utilities/render/luci/qmldir new file mode 100644 index 0000000000..cf63b1c2b7 --- /dev/null +++ b/scripts/developer/utilities/render/luci/qmldir @@ -0,0 +1,2 @@ + +ShadingModel 1.0 ShadingModel.qml \ No newline at end of file