diff --git a/interface/resources/qml/controls-uit/CheckBox.qml b/interface/resources/qml/controls-uit/CheckBox.qml index 916a7d4889..5c49a0775d 100644 --- a/interface/resources/qml/controls-uit/CheckBox.qml +++ b/interface/resources/qml/controls-uit/CheckBox.qml @@ -21,7 +21,7 @@ Original.CheckBox { readonly property bool isLightColorScheme: colorScheme == hifi.colorSchemes.light property bool isRedCheck: false property int boxSize: 14 - readonly property int boxRadius: 3 + property int boxRadius: 3 readonly property int checkSize: Math.max(boxSize - 8, 10) readonly property int checkRadius: 2 activeFocusOnPress: true diff --git a/interface/resources/qml/hifi/tablet/InputConfiguration.qml b/interface/resources/qml/hifi/tablet/InputConfiguration.qml index 10f03f9edf..56f0e0fe14 100644 --- a/interface/resources/qml/hifi/tablet/InputConfiguration.qml +++ b/interface/resources/qml/hifi/tablet/InputConfiguration.qml @@ -64,7 +64,7 @@ Rectangle { Row { id: configRow - + z: 999 anchors.top: configuration.bottom anchors.topMargin: 20 anchors.left: configuration.left @@ -73,13 +73,14 @@ Rectangle { HifiControls.ComboBox { id: box width: 160 + z: 999 editable: true colorScheme: hifi.colorSchemes.dark model: inputPlugins() onCurrentIndexChanged: { - var object = {"Test": "hello"}; - InputConfiguration.configurationSettings(object, box.currentText); + loader.source = "" + loader.source = InputConfiguration.configurationLayout(box.currentText); } } @@ -95,6 +96,42 @@ Rectangle { } + + Separator { + id: configurationSeperator + z: 0 + width: inputConfiguration.width + anchors.top: configRow.bottom + anchors.topMargin: 10 + } + + Row { + z: 0 + id: configurationHeader + anchors.top: configurationSeperator.bottom + anchors.topMargin: 20 + anchors.left: inputConfiguration.left + anchors.leftMargin: 40 + spacing: 10 + RalewayBold { + text: "CONFIGURATION" + size: 18 + color: hifi.colors.lightGray + } + } + + Loader { + id: loader + asynchronous: false + + width: configurationHeader.width + anchors.left: inputConfiguration.left + anchors.right: inputConfiguration.right + anchors.top: configurationHeader.bottom + anchors.topMargin: 10 + anchors.bottom: inputConfiguration.bottom + } + function inputPlugins() { return InputConfiguration.inputPlugins(); } diff --git a/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml new file mode 100644 index 0000000000..c20f01ad6e --- /dev/null +++ b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml @@ -0,0 +1,253 @@ +// +// Created by Dante Ruiz on 6/5/17. +// Copyright 2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +import QtQuick 2.5 +import QtGraphicalEffects 1.0 +import "../../styles-uit" +import "../../controls" +import "../../controls-uit" as HifiControls + + +Rectangle { + id: openVrConfiguration + + width: parent.width + height: parent.height + anchors.fill: parent + + property int leftMargin: 55 + + HifiConstants { id: hifi } + + color: hifi.colors.baseGray + + RalewayBold { + id: head + + text: "Head:" + size: 15 + + color: "white" + + anchors.left: parent.left + anchors.leftMargin: leftMargin + } + + Row { + id: headConfig + anchors.top: head.bottom + anchors.topMargin: 5 + anchors.left: openVrConfiguration.left + anchors.leftMargin: leftMargin + 20 + spacing: 10 + + HifiControls.CheckBox { + id: headBox + width: 15 + height: 15 + boxRadius: 7 + } + + RalewayBold { + size: 15 + text: "Vive HMD" + color: hifi.colors.lightGrayText + } + + HifiControls.CheckBox { + id: headPuckBox + width: 15 + height: 15 + boxRadius: 7 + } + + RalewayBold { + size: 15 + text: "Tracker" + color: hifi.colors.lightGrayText + } + } + + RalewayBold { + id: hands + + text: "Hands:" + size: 15 + + color: "white" + + anchors.top: headConfig.bottom + anchors.topMargin: 10 + anchors.left: parent.left + anchors.leftMargin: leftMargin + } + + Row { + id: handConfig + anchors.top: hands.bottom + anchors.topMargin: 5 + anchors.left: openVrConfiguration.left + anchors.leftMargin: leftMargin + 20 + spacing: 10 + + HifiControls.CheckBox { + id: handBox + width: 15 + height: 15 + boxRadius: 7 + } + + RalewayBold { + size: 15 + text: "Controllers" + color: hifi.colors.lightGrayText + } + + HifiControls.CheckBox { + id: handPuckBox + width: 15 + height: 15 + boxRadius: 7 + } + + RalewayBold { + size: 15 + text: "Trackers" + color: hifi.colors.lightGrayText + } + } + + RalewayBold { + id: additional + + text: "Additional Trackers" + size: 15 + + color: hifi.colors.white + + anchors.top: handConfig.bottom + anchors.topMargin: 10 + anchors.left: parent.left + anchors.leftMargin: leftMargin + } + + Row { + id: feetConfig + anchors.top: additional.bottom + anchors.topMargin: 15 + anchors.left: openVrConfiguration.left + anchors.leftMargin: leftMargin + 20 + spacing: 10 + + HifiControls.CheckBox { + id: feetBox + width: 15 + height: 15 + boxRadius: 7 + } + + RalewayBold { + size: 15 + text: "Feet" + color: hifi.colors.lightGrayText + } + } + + Row { + id: hipConfig + anchors.top: feetConfig.bottom + anchors.topMargin: 15 + anchors.left: openVrConfiguration.left + anchors.leftMargin: leftMargin + 20 + spacing: 10 + + HifiControls.CheckBox { + id: hipBox + width: 15 + height: 15 + boxRadius: 7 + } + + RalewayBold { + size: 15 + text: "Hips" + color: hifi.colors.lightGrayText + } + + RalewayBold { + size: 12 + text: "requires feet" + color: hifi.colors.lightGray + } + } + + + Row { + id: chestConfig + anchors.top: hipConfig.bottom + anchors.topMargin: 15 + anchors.left: openVrConfiguration.left + anchors.leftMargin: leftMargin + 20 + spacing: 10 + + HifiControls.CheckBox { + id: chestBox + width: 15 + height: 15 + boxRadius: 7 + } + + RalewayBold { + size: 15 + text: "Chest" + color: hifi.colors.lightGrayText + } + + RalewayBold { + size: 12 + text: "requires hips" + color: hifi.colors.lightGray + } + } + + + Row { + id: shoulderConfig + anchors.top: chestConfig.bottom + anchors.topMargin: 15 + anchors.left: openVrConfiguration.left + anchors.leftMargin: leftMargin + 20 + spacing: 10 + + HifiControls.CheckBox { + id: shoulderBox + width: 15 + height: 15 + boxRadius: 7 + } + + RalewayBold { + size: 15 + text: "Shoulders" + color: hifi.colors.lightGrayText + } + + RalewayBold { + size: 12 + text: "requires hips" + color: hifi.colors.lightGray + } + } + + Separator { + id: bottomSeperator + width: parent.width + anchors.top: shoulderConfig.bottom + anchors.topMargin: 10 + } +} diff --git a/libraries/plugins/src/plugins/InputConfiguration.cpp b/libraries/plugins/src/plugins/InputConfiguration.cpp index 8f8daf716a..14472a5ec7 100644 --- a/libraries/plugins/src/plugins/InputConfiguration.cpp +++ b/libraries/plugins/src/plugins/InputConfiguration.cpp @@ -39,7 +39,7 @@ QString InputConfiguration::configurationLayout(QString pluginName) { for (auto plugin : PluginManager::getInstance()->getInputPlugins()) { if (plugin->getName() == pluginName) { - qDebug() << "------------> testing <----------"; + return plugin->configurationLayout(); } } return sourcePath; diff --git a/libraries/plugins/src/plugins/InputPlugin.h b/libraries/plugins/src/plugins/InputPlugin.h index eb8aca660b..94c7595eb9 100644 --- a/libraries/plugins/src/plugins/InputPlugin.h +++ b/libraries/plugins/src/plugins/InputPlugin.h @@ -26,5 +26,6 @@ public: // If an input plugin is only a single device, it will only return it's primary name. virtual QStringList getSubdeviceNames() { return { getName() }; }; virtual bool isHandController() const = 0; - virtual void inputPluginConfigurationSettings(const QJsonObject configurationSettings) { } + virtual void configurationSettings(const QJsonObject configurationSettings) { } + virtual QString configurationLayout() { return QString(); } }; diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index c33dd30360..2337c6161b 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -39,7 +39,7 @@ extern PoseData _nextSimPoseData; vr::IVRSystem* acquireOpenVrSystem(); void releaseOpenVrSystem(); - +static const QString OPENVR_LAYOUT = QString("OpenVrConfiguration.qml"); static const char* CONTROLLER_MODEL_STRING = "vr_controller_05_wireless_b"; const quint64 CALIBRATION_TIMELAPSE = 1 * USECS_PER_SECOND; @@ -120,7 +120,11 @@ bool ViveControllerManager::isSupported() const { return openVrSupported(); } -void ViveControllerManager::inputPluginConfigurationSettings(const QJsonObject configurationSettings) { +void ViveControllerManager::configurationSettings(const QJsonObject configurationSettings) { +} + +QString ViveControllerManager::configurationLayout() { + return OPENVR_LAYOUT; } bool ViveControllerManager::activate() { diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index bf3a7af3fb..b8a6206d60 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -42,7 +42,8 @@ public: bool isHandController() const override { return true; } - void inputPluginConfigurationSettings(const QJsonObject configurationSettings) override; + QString configurationLayout() override; + void configurationSettings(const QJsonObject configurationSettings) override; bool activate() override; void deactivate() override;