mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:53:25 +02:00
get ui working
This commit is contained in:
parent
038ffe920a
commit
bb7c424d47
7 changed files with 305 additions and 9 deletions
|
@ -21,7 +21,7 @@ Original.CheckBox {
|
||||||
readonly property bool isLightColorScheme: colorScheme == hifi.colorSchemes.light
|
readonly property bool isLightColorScheme: colorScheme == hifi.colorSchemes.light
|
||||||
property bool isRedCheck: false
|
property bool isRedCheck: false
|
||||||
property int boxSize: 14
|
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 checkSize: Math.max(boxSize - 8, 10)
|
||||||
readonly property int checkRadius: 2
|
readonly property int checkRadius: 2
|
||||||
activeFocusOnPress: true
|
activeFocusOnPress: true
|
||||||
|
|
|
@ -64,7 +64,7 @@ Rectangle {
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: configRow
|
id: configRow
|
||||||
|
z: 999
|
||||||
anchors.top: configuration.bottom
|
anchors.top: configuration.bottom
|
||||||
anchors.topMargin: 20
|
anchors.topMargin: 20
|
||||||
anchors.left: configuration.left
|
anchors.left: configuration.left
|
||||||
|
@ -73,13 +73,14 @@ Rectangle {
|
||||||
HifiControls.ComboBox {
|
HifiControls.ComboBox {
|
||||||
id: box
|
id: box
|
||||||
width: 160
|
width: 160
|
||||||
|
z: 999
|
||||||
editable: true
|
editable: true
|
||||||
colorScheme: hifi.colorSchemes.dark
|
colorScheme: hifi.colorSchemes.dark
|
||||||
model: inputPlugins()
|
model: inputPlugins()
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
var object = {"Test": "hello"};
|
loader.source = ""
|
||||||
InputConfiguration.configurationSettings(object, box.currentText);
|
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() {
|
function inputPlugins() {
|
||||||
return InputConfiguration.inputPlugins();
|
return InputConfiguration.inputPlugins();
|
||||||
}
|
}
|
||||||
|
|
253
interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml
Normal file
253
interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml
Normal file
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
|
@ -39,7 +39,7 @@ QString InputConfiguration::configurationLayout(QString pluginName) {
|
||||||
|
|
||||||
for (auto plugin : PluginManager::getInstance()->getInputPlugins()) {
|
for (auto plugin : PluginManager::getInstance()->getInputPlugins()) {
|
||||||
if (plugin->getName() == pluginName) {
|
if (plugin->getName() == pluginName) {
|
||||||
qDebug() << "------------> testing <----------";
|
return plugin->configurationLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sourcePath;
|
return sourcePath;
|
||||||
|
|
|
@ -26,5 +26,6 @@ public:
|
||||||
// If an input plugin is only a single device, it will only return it's primary name.
|
// If an input plugin is only a single device, it will only return it's primary name.
|
||||||
virtual QStringList getSubdeviceNames() { return { getName() }; };
|
virtual QStringList getSubdeviceNames() { return { getName() }; };
|
||||||
virtual bool isHandController() const = 0;
|
virtual bool isHandController() const = 0;
|
||||||
virtual void inputPluginConfigurationSettings(const QJsonObject configurationSettings) { }
|
virtual void configurationSettings(const QJsonObject configurationSettings) { }
|
||||||
|
virtual QString configurationLayout() { return QString(); }
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,7 +39,7 @@ extern PoseData _nextSimPoseData;
|
||||||
vr::IVRSystem* acquireOpenVrSystem();
|
vr::IVRSystem* acquireOpenVrSystem();
|
||||||
void releaseOpenVrSystem();
|
void releaseOpenVrSystem();
|
||||||
|
|
||||||
|
static const QString OPENVR_LAYOUT = QString("OpenVrConfiguration.qml");
|
||||||
static const char* CONTROLLER_MODEL_STRING = "vr_controller_05_wireless_b";
|
static const char* CONTROLLER_MODEL_STRING = "vr_controller_05_wireless_b";
|
||||||
const quint64 CALIBRATION_TIMELAPSE = 1 * USECS_PER_SECOND;
|
const quint64 CALIBRATION_TIMELAPSE = 1 * USECS_PER_SECOND;
|
||||||
|
|
||||||
|
@ -120,7 +120,11 @@ bool ViveControllerManager::isSupported() const {
|
||||||
return openVrSupported();
|
return openVrSupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViveControllerManager::inputPluginConfigurationSettings(const QJsonObject configurationSettings) {
|
void ViveControllerManager::configurationSettings(const QJsonObject configurationSettings) {
|
||||||
|
}
|
||||||
|
|
||||||
|
QString ViveControllerManager::configurationLayout() {
|
||||||
|
return OPENVR_LAYOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ViveControllerManager::activate() {
|
bool ViveControllerManager::activate() {
|
||||||
|
|
|
@ -42,7 +42,8 @@ public:
|
||||||
|
|
||||||
bool isHandController() const override { return true; }
|
bool isHandController() const override { return true; }
|
||||||
|
|
||||||
void inputPluginConfigurationSettings(const QJsonObject configurationSettings) override;
|
QString configurationLayout() override;
|
||||||
|
void configurationSettings(const QJsonObject configurationSettings) override;
|
||||||
|
|
||||||
bool activate() override;
|
bool activate() override;
|
||||||
void deactivate() override;
|
void deactivate() override;
|
||||||
|
|
Loading…
Reference in a new issue