From 1dbeac7b882433a01bc553f53fc4315bee057bf1 Mon Sep 17 00:00:00 2001 From: samcake Date: Thu, 26 Oct 2017 19:55:59 -0700 Subject: [PATCH] Adding the idons for Luci and cleaning up the scripts --- .../utilities/lib/configprop/ConfigSlider.qml | 75 ------------------- .../render/configSlider/ConfigSlider.qml | 44 ++++++----- .../utilities/render/debugDeferredLighting.js | 49 ------------ .../utilities/render/deferredLighting.qml | 4 +- scripts/developer/utilities/render/luci.js | 6 +- scripts/system/assets/images/luci-a.svg | 10 +++ scripts/system/assets/images/luci-i.svg | 13 ++++ 7 files changed, 56 insertions(+), 145 deletions(-) delete mode 100644 scripts/developer/utilities/lib/configprop/ConfigSlider.qml delete mode 100644 scripts/developer/utilities/render/debugDeferredLighting.js create mode 100644 scripts/system/assets/images/luci-a.svg create mode 100644 scripts/system/assets/images/luci-i.svg diff --git a/scripts/developer/utilities/lib/configprop/ConfigSlider.qml b/scripts/developer/utilities/lib/configprop/ConfigSlider.qml deleted file mode 100644 index bb46536fdc..0000000000 --- a/scripts/developer/utilities/lib/configprop/ConfigSlider.qml +++ /dev/null @@ -1,75 +0,0 @@ -// -// ConfigSlider.qml -// -// Created by Zach Pomerantz on 2/8/2016 -// Copyright 2016 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 QtQuick.Controls 1.4 as Original -import QtQuick.Controls.Styles 1.4 - -import "qrc:///qml/styles-uit" -import "qrc:///qml/controls-uit" as HifiControls - - -Item { - HifiConstants { id: luci } - id: root - - anchors.left: parent.left - anchors.right: parent.right - height: 24 - property bool integral: false - property var config - property string property - property alias label: labelControl.text - property alias min: sliderControl.minimumValue - property alias max: sliderControl.maximumValue - - Component.onCompleted: { - // Binding favors qml value, so set it first - sliderControl.value = root.config[root.property]; - bindingControl.when = true; - } - - HifiControls.Label { - id: labelControl - text: root.label - enabled: true - anchors.left: root.left - anchors.right: root.horizontalCenter - anchors.verticalCenter: root.verticalCenter - //anchors.topMargin: 7 - } - - HifiControls.Label { - id: labelValue - text: sliderControl.value.toFixed(root.integral ? 0 : 2) - anchors.right: root.right - anchors.bottom: root.bottom - anchors.bottomMargin: 0 - } - - Binding { - id: bindingControl - target: root.config - property: root.property - value: sliderControl.value - when: false - } - - HifiControls.Slider { - id: sliderControl - stepSize: root.integral ? 1.0 : 0.0 - //height: 20 - anchors.left: root.horizontalCenter - anchors.right: root.right - anchors.rightMargin: 0 - anchors.top: root.top - anchors.topMargin: 0 - } -} diff --git a/scripts/developer/utilities/render/configSlider/ConfigSlider.qml b/scripts/developer/utilities/render/configSlider/ConfigSlider.qml index 021365686a..bb46536fdc 100644 --- a/scripts/developer/utilities/render/configSlider/ConfigSlider.qml +++ b/scripts/developer/utilities/render/configSlider/ConfigSlider.qml @@ -1,6 +1,5 @@ // // ConfigSlider.qml -// examples/utilities/tools/render // // Created by Zach Pomerantz on 2/8/2016 // Copyright 2016 High Fidelity, Inc. @@ -8,12 +7,21 @@ // 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.5 -import QtQuick.Controls 1.4 + +import QtQuick 2.7 +import QtQuick.Controls 1.4 as Original +import QtQuick.Controls.Styles 1.4 + +import "qrc:///qml/styles-uit" +import "qrc:///qml/controls-uit" as HifiControls + Item { + HifiConstants { id: luci } id: root - width: 400 + + anchors.left: parent.left + anchors.right: parent.right height: 24 property bool integral: false property var config @@ -28,22 +36,22 @@ Item { bindingControl.when = true; } - Label { + HifiControls.Label { id: labelControl text: root.label + enabled: true anchors.left: root.left - anchors.leftMargin: 8 - anchors.top: root.top - anchors.topMargin: 7 + anchors.right: root.horizontalCenter + anchors.verticalCenter: root.verticalCenter + //anchors.topMargin: 7 } - Label { + HifiControls.Label { id: labelValue text: sliderControl.value.toFixed(root.integral ? 0 : 2) - anchors.left: root.left - anchors.leftMargin: 200 - anchors.top: root.top - anchors.topMargin: 15 + anchors.right: root.right + anchors.bottom: root.bottom + anchors.bottomMargin: 0 } Binding { @@ -54,14 +62,14 @@ Item { when: false } - Slider { + HifiControls.Slider { id: sliderControl stepSize: root.integral ? 1.0 : 0.0 - width: root.width-130 - height: 20 + //height: 20 + anchors.left: root.horizontalCenter anchors.right: root.right - anchors.rightMargin: 8 + anchors.rightMargin: 0 anchors.top: root.top - anchors.topMargin: 3 + anchors.topMargin: 0 } } diff --git a/scripts/developer/utilities/render/debugDeferredLighting.js b/scripts/developer/utilities/render/debugDeferredLighting.js deleted file mode 100644 index 2a9b1a1067..0000000000 --- a/scripts/developer/utilities/render/debugDeferredLighting.js +++ /dev/null @@ -1,49 +0,0 @@ -// -// debugDeferredLighting.js -// -// Created by Sam Gateau on 6/6/2016 -// Copyright 2016 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 -// - -// Set up the qml ui -var qml = Script.resolvePath('deferredLighting.qml'); -var window = new OverlayWindow({ - title: 'Lighting', - source: qml, - width: 400, height:400, -}); -window.setPosition(Window.innerWidth - 420, 50); -window.closed.connect(function() { Script.stop(); }); - - -var DDB = Render.RenderDeferredTask.DebugDeferredBuffer; -DDB.enabled = true; -DDB.mode = 0; - -// Debug buffer sizing -var resizing = false; -Controller.mousePressEvent.connect(function (e) { - if (shouldStartResizing(e.x)) { - resizing = true; - } -}); -Controller.mouseReleaseEvent.connect(function() { resizing = false; }); -Controller.mouseMoveEvent.connect(function (e) { resizing && setDebugBufferSize(e.x); }); -Script.scriptEnding.connect(function () { DDB.enabled = false; }); - -function shouldStartResizing(eventX) { - var x = Math.abs(eventX - Window.innerWidth * (1.0 + DDB.size.x) / 2.0); - var mode = DDB.mode; - return mode !== 0 && x < 20; -} - -function setDebugBufferSize(x) { - x = (2.0 * (x / Window.innerWidth) - 1.0); // scale - x = Math.min(Math.max(-1, x), 1); // clamp - DDB.size = { x: x, y: -1, z: 1, w: 1 }; -} - - diff --git a/scripts/developer/utilities/render/deferredLighting.qml b/scripts/developer/utilities/render/deferredLighting.qml index d2f778c3a6..afb1f24baf 100644 --- a/scripts/developer/utilities/render/deferredLighting.qml +++ b/scripts/developer/utilities/render/deferredLighting.qml @@ -13,7 +13,7 @@ import QtQuick.Layouts 1.3 import "qrc:///qml/styles-uit" import "qrc:///qml/controls-uit" as HifiControls -import "../lib/configprop" +import "configSlider" Rectangle { HifiConstants { id: hifi;} @@ -36,7 +36,7 @@ Rectangle { anchors.right: parent.right // padding: hifi.dimensions.contentMargin.x - ConfigSlider { + ConfigSlider { label: qsTr("ToneMapping") integral: false config: render.mainViewTask.getConfig("ToneMapping") diff --git a/scripts/developer/utilities/render/luci.js b/scripts/developer/utilities/render/luci.js index 3e0beb2181..1e2ac1261f 100644 --- a/scripts/developer/utilities/render/luci.js +++ b/scripts/developer/utilities/render/luci.js @@ -13,6 +13,8 @@ (function() { var TABLET_BUTTON_NAME = "LUCI"; var QMLAPP_URL = Script.resolvePath("./deferredLighting.qml"); + var ICON_URL = Script.resolvePath("../../../system/assets/images/luci-i.svg"); + var ACTIVE_ICON_URL = Script.resolvePath("../../../system/assets/images/luci-a.svg"); var onLuciScreen = false; @@ -27,7 +29,9 @@ var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ - text: TABLET_BUTTON_NAME, + text: TABLET_BUTTON_NAME, + icon: ICON_URL, + activeIcon: ACTIVE_ICON_URL, sortOrder: 1 }); diff --git a/scripts/system/assets/images/luci-a.svg b/scripts/system/assets/images/luci-a.svg new file mode 100644 index 0000000000..40e1481eba --- /dev/null +++ b/scripts/system/assets/images/luci-a.svg @@ -0,0 +1,10 @@ + + + + + + + diff --git a/scripts/system/assets/images/luci-i.svg b/scripts/system/assets/images/luci-i.svg new file mode 100644 index 0000000000..2d73339908 --- /dev/null +++ b/scripts/system/assets/images/luci-i.svg @@ -0,0 +1,13 @@ + + + + + + + +