mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 18:16:45 +02:00
Adding the idons for Luci and cleaning up the scripts
This commit is contained in:
parent
0636a2db06
commit
1dbeac7b88
7 changed files with 56 additions and 145 deletions
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,5 @@
|
||||||
//
|
//
|
||||||
// ConfigSlider.qml
|
// ConfigSlider.qml
|
||||||
// examples/utilities/tools/render
|
|
||||||
//
|
//
|
||||||
// Created by Zach Pomerantz on 2/8/2016
|
// Created by Zach Pomerantz on 2/8/2016
|
||||||
// Copyright 2016 High Fidelity, Inc.
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
@ -8,12 +7,21 @@
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
|
// 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 {
|
Item {
|
||||||
|
HifiConstants { id: luci }
|
||||||
id: root
|
id: root
|
||||||
width: 400
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
height: 24
|
height: 24
|
||||||
property bool integral: false
|
property bool integral: false
|
||||||
property var config
|
property var config
|
||||||
|
@ -28,22 +36,22 @@ Item {
|
||||||
bindingControl.when = true;
|
bindingControl.when = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
HifiControls.Label {
|
||||||
id: labelControl
|
id: labelControl
|
||||||
text: root.label
|
text: root.label
|
||||||
|
enabled: true
|
||||||
anchors.left: root.left
|
anchors.left: root.left
|
||||||
anchors.leftMargin: 8
|
anchors.right: root.horizontalCenter
|
||||||
anchors.top: root.top
|
anchors.verticalCenter: root.verticalCenter
|
||||||
anchors.topMargin: 7
|
//anchors.topMargin: 7
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
HifiControls.Label {
|
||||||
id: labelValue
|
id: labelValue
|
||||||
text: sliderControl.value.toFixed(root.integral ? 0 : 2)
|
text: sliderControl.value.toFixed(root.integral ? 0 : 2)
|
||||||
anchors.left: root.left
|
anchors.right: root.right
|
||||||
anchors.leftMargin: 200
|
anchors.bottom: root.bottom
|
||||||
anchors.top: root.top
|
anchors.bottomMargin: 0
|
||||||
anchors.topMargin: 15
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Binding {
|
Binding {
|
||||||
|
@ -54,14 +62,14 @@ Item {
|
||||||
when: false
|
when: false
|
||||||
}
|
}
|
||||||
|
|
||||||
Slider {
|
HifiControls.Slider {
|
||||||
id: sliderControl
|
id: sliderControl
|
||||||
stepSize: root.integral ? 1.0 : 0.0
|
stepSize: root.integral ? 1.0 : 0.0
|
||||||
width: root.width-130
|
//height: 20
|
||||||
height: 20
|
anchors.left: root.horizontalCenter
|
||||||
anchors.right: root.right
|
anchors.right: root.right
|
||||||
anchors.rightMargin: 8
|
anchors.rightMargin: 0
|
||||||
anchors.top: root.top
|
anchors.top: root.top
|
||||||
anchors.topMargin: 3
|
anchors.topMargin: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 };
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
import "qrc:///qml/styles-uit"
|
import "qrc:///qml/styles-uit"
|
||||||
import "qrc:///qml/controls-uit" as HifiControls
|
import "qrc:///qml/controls-uit" as HifiControls
|
||||||
import "../lib/configprop"
|
import "configSlider"
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
HifiConstants { id: hifi;}
|
HifiConstants { id: hifi;}
|
||||||
|
@ -36,7 +36,7 @@ Rectangle {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
// padding: hifi.dimensions.contentMargin.x
|
// padding: hifi.dimensions.contentMargin.x
|
||||||
|
|
||||||
ConfigSlider {
|
ConfigSlider {
|
||||||
label: qsTr("ToneMapping")
|
label: qsTr("ToneMapping")
|
||||||
integral: false
|
integral: false
|
||||||
config: render.mainViewTask.getConfig("ToneMapping")
|
config: render.mainViewTask.getConfig("ToneMapping")
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
(function() {
|
(function() {
|
||||||
var TABLET_BUTTON_NAME = "LUCI";
|
var TABLET_BUTTON_NAME = "LUCI";
|
||||||
var QMLAPP_URL = Script.resolvePath("./deferredLighting.qml");
|
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;
|
var onLuciScreen = false;
|
||||||
|
@ -27,7 +29,9 @@
|
||||||
|
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
var button = tablet.addButton({
|
var button = tablet.addButton({
|
||||||
text: TABLET_BUTTON_NAME,
|
text: TABLET_BUTTON_NAME,
|
||||||
|
icon: ICON_URL,
|
||||||
|
activeIcon: ACTIVE_ICON_URL,
|
||||||
sortOrder: 1
|
sortOrder: 1
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
10
scripts/system/assets/images/luci-a.svg
Normal file
10
scripts/system/assets/images/luci-a.svg
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
|
||||||
|
<path d="M18.5,36.5c-6.8-2.2-6.8-11.8-0.1-14.1l12.1-4.1c-2.6-2.4-6.1-3.8-9.9-3.8c-8.2,0-14.8,6.6-14.8,14.8
|
||||||
|
c0,8.2,6.6,14.8,14.8,14.8c3.7,0,7.1-1.4,9.7-3.7L18.5,36.5z"/>
|
||||||
|
<path d="M31.9,17.9c-0.5,0.2-0.9,0.3-1.3,0.5c2.9,2.7,4.8,6.6,4.8,10.9c0,4.4-1.9,8.3-4.9,11c0.5,0.2,1,0.5,1.6,0.7l5.9,2.4
|
||||||
|
c3.1,1,6.2-1.3,6.2-4.5V13.2L31.9,17.9z"/>
|
||||||
|
<circle cx="40" cy="6.6" r="3.7"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 721 B |
13
scripts/system/assets/images/luci-i.svg
Normal file
13
scripts/system/assets/images/luci-i.svg
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
|
||||||
|
<style type="text/css">
|
||||||
|
.st0{fill:#FFFFFF;}
|
||||||
|
</style>
|
||||||
|
<path class="st0" d="M18.5,36.5c-6.8-2.2-6.8-11.8-0.1-14.1l12.1-4.1c-2.6-2.4-6.1-3.8-9.9-3.8c-8.2,0-14.8,6.6-14.8,14.8
|
||||||
|
c0,8.2,6.6,14.8,14.8,14.8c3.7,0,7.1-1.4,9.7-3.7L18.5,36.5z"/>
|
||||||
|
<path class="st0" d="M31.9,17.9c-0.5,0.2-0.9,0.3-1.3,0.5c2.9,2.7,4.8,6.6,4.8,10.9c0,4.4-1.9,8.3-4.9,11c0.5,0.2,1,0.5,1.6,0.7
|
||||||
|
l5.9,2.4c3.1,1,6.2-1.3,6.2-4.5V13.2L31.9,17.9z"/>
|
||||||
|
<circle class="st0" cx="40" cy="6.6" r="3.7"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 811 B |
Loading…
Reference in a new issue