mirror of
https://github.com/lubosz/overte.git
synced 2025-04-18 04:18:17 +02:00
finished openvr ui
This commit is contained in:
parent
8d6e4bf28c
commit
70ba344f1b
6 changed files with 138 additions and 42 deletions
|
@ -29,7 +29,7 @@ Rectangle {
|
|||
x: -hifi.dimensions.contentMargin.x
|
||||
}
|
||||
|
||||
RalewayBold {
|
||||
RalewayRegular {
|
||||
id: header
|
||||
text: "Controller Settings"
|
||||
size: 22
|
||||
|
@ -49,25 +49,38 @@ Rectangle {
|
|||
anchors.topMargin: 10
|
||||
}
|
||||
|
||||
RalewayBold {
|
||||
id: configuration
|
||||
text: "SELECT DEVICE"
|
||||
size: 18
|
||||
color: hifi.colors.lightGray
|
||||
|
||||
HiFiGlyphs {
|
||||
id: sourceGlyph
|
||||
text: hifi.glyphs.source
|
||||
size: 36
|
||||
color: hifi.colors.blueHighlight
|
||||
|
||||
anchors.top: headerSeparator.bottom
|
||||
anchors.left: inputConfiguration.left
|
||||
anchors.leftMargin: 20
|
||||
anchors.leftMargin: 40
|
||||
anchors.topMargin: 20
|
||||
}
|
||||
|
||||
RalewayRegular {
|
||||
id: configuration
|
||||
text: "SELECT DEVICE"
|
||||
size: 15
|
||||
color: hifi.colors.lightGrayText
|
||||
|
||||
|
||||
anchors.top: headerSeparator.bottom
|
||||
anchors.left: sourceGlyph.right
|
||||
anchors.leftMargin: 10
|
||||
anchors.topMargin: 30
|
||||
anchors.verticalCenter: sourceGlyph.horizontalCenter
|
||||
}
|
||||
|
||||
Row {
|
||||
id: configRow
|
||||
z: 999
|
||||
anchors.top: configuration.bottom
|
||||
anchors.top: sourceGlyph.bottom
|
||||
anchors.topMargin: 20
|
||||
anchors.left: configuration.left
|
||||
anchors.left: sourceGlyph.left
|
||||
anchors.leftMargin: 40
|
||||
spacing: 10
|
||||
HifiControls.ComboBox {
|
||||
|
@ -98,38 +111,57 @@ Rectangle {
|
|||
|
||||
|
||||
Separator {
|
||||
id: configurationSeperator
|
||||
id: configurationSeparator
|
||||
z: 0
|
||||
width: inputConfiguration.width
|
||||
anchors.top: configRow.bottom
|
||||
anchors.topMargin: 10
|
||||
}
|
||||
|
||||
Row {
|
||||
z: 0
|
||||
id: configurationHeader
|
||||
anchors.top: configurationSeperator.bottom
|
||||
anchors.topMargin: 20
|
||||
|
||||
HiFiGlyphs {
|
||||
id: sliderGlyph
|
||||
text: hifi.glyphs.sliders
|
||||
size: 36
|
||||
color: hifi.colors.blueHighlight
|
||||
|
||||
anchors.top: configurationSeparator.bottom
|
||||
anchors.left: inputConfiguration.left
|
||||
anchors.leftMargin: 40
|
||||
spacing: 10
|
||||
RalewayBold {
|
||||
text: "CONFIGURATION"
|
||||
size: 18
|
||||
color: hifi.colors.lightGray
|
||||
}
|
||||
anchors.topMargin: 20
|
||||
}
|
||||
|
||||
RalewayRegular {
|
||||
id: configurationHeader
|
||||
text: "CONFIGURATION"
|
||||
size: 15
|
||||
color: hifi.colors.lightGrayText
|
||||
|
||||
|
||||
anchors.top: configurationSeparator.bottom
|
||||
anchors.left: sliderGlyph.right
|
||||
anchors.leftMargin: 10
|
||||
anchors.topMargin: 30
|
||||
anchors.verticalCenter: sliderGlyph.horizontalCenter
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
asynchronous: false
|
||||
|
||||
width: configurationHeader.width
|
||||
width: inputConfiguration.width
|
||||
anchors.left: inputConfiguration.left
|
||||
anchors.right: inputConfiguration.right
|
||||
anchors.top: configurationHeader.bottom
|
||||
anchors.topMargin: 10
|
||||
anchors.bottom: inputConfiguration.bottom
|
||||
|
||||
|
||||
onLoaded: {
|
||||
if (loader.item.hasOwnProeprty("pluginName")) {
|
||||
loader.item.pluginName = box.currentText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function inputPlugins() {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
//
|
||||
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import QtGraphicalEffects 1.0
|
||||
import "../../styles-uit"
|
||||
import "../../controls"
|
||||
|
@ -20,7 +21,8 @@ Rectangle {
|
|||
height: parent.height
|
||||
anchors.fill: parent
|
||||
|
||||
property int leftMargin: 55
|
||||
property int leftMargin: 75
|
||||
property string pluginName: ""
|
||||
|
||||
HifiConstants { id: hifi }
|
||||
|
||||
|
@ -30,7 +32,7 @@ Rectangle {
|
|||
id: head
|
||||
|
||||
text: "Head:"
|
||||
size: 15
|
||||
size: 12
|
||||
|
||||
color: "white"
|
||||
|
||||
|
@ -54,7 +56,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
RalewayBold {
|
||||
size: 15
|
||||
size: 12
|
||||
text: "Vive HMD"
|
||||
color: hifi.colors.lightGrayText
|
||||
}
|
||||
|
@ -67,7 +69,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
RalewayBold {
|
||||
size: 15
|
||||
size: 12
|
||||
text: "Tracker"
|
||||
color: hifi.colors.lightGrayText
|
||||
}
|
||||
|
@ -77,7 +79,7 @@ Rectangle {
|
|||
id: hands
|
||||
|
||||
text: "Hands:"
|
||||
size: 15
|
||||
size: 12
|
||||
|
||||
color: "white"
|
||||
|
||||
|
@ -103,20 +105,20 @@ Rectangle {
|
|||
}
|
||||
|
||||
RalewayBold {
|
||||
size: 15
|
||||
size: 12
|
||||
text: "Controllers"
|
||||
color: hifi.colors.lightGrayText
|
||||
}
|
||||
|
||||
HifiControls.CheckBox {
|
||||
id: handPuckBox
|
||||
width: 15
|
||||
width: 12
|
||||
height: 15
|
||||
boxRadius: 7
|
||||
}
|
||||
|
||||
RalewayBold {
|
||||
size: 15
|
||||
size: 12
|
||||
text: "Trackers"
|
||||
color: hifi.colors.lightGrayText
|
||||
}
|
||||
|
@ -126,7 +128,7 @@ Rectangle {
|
|||
id: additional
|
||||
|
||||
text: "Additional Trackers"
|
||||
size: 15
|
||||
size: 12
|
||||
|
||||
color: hifi.colors.white
|
||||
|
||||
|
@ -152,7 +154,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
RalewayBold {
|
||||
size: 15
|
||||
size: 12
|
||||
text: "Feet"
|
||||
color: hifi.colors.lightGrayText
|
||||
}
|
||||
|
@ -174,12 +176,12 @@ Rectangle {
|
|||
}
|
||||
|
||||
RalewayBold {
|
||||
size: 15
|
||||
size: 12
|
||||
text: "Hips"
|
||||
color: hifi.colors.lightGrayText
|
||||
}
|
||||
|
||||
RalewayBold {
|
||||
RalewayRegular {
|
||||
size: 12
|
||||
text: "requires feet"
|
||||
color: hifi.colors.lightGray
|
||||
|
@ -203,12 +205,12 @@ Rectangle {
|
|||
}
|
||||
|
||||
RalewayBold {
|
||||
size: 15
|
||||
size: 12
|
||||
text: "Chest"
|
||||
color: hifi.colors.lightGrayText
|
||||
}
|
||||
|
||||
RalewayBold {
|
||||
RalewayRegular {
|
||||
size: 12
|
||||
text: "requires hips"
|
||||
color: hifi.colors.lightGray
|
||||
|
@ -216,7 +218,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
|
||||
Row {
|
||||
Row {
|
||||
id: shoulderConfig
|
||||
anchors.top: chestConfig.bottom
|
||||
anchors.topMargin: 15
|
||||
|
@ -232,22 +234,72 @@ Rectangle {
|
|||
}
|
||||
|
||||
RalewayBold {
|
||||
size: 15
|
||||
size: 12
|
||||
text: "Shoulders"
|
||||
color: hifi.colors.lightGrayText
|
||||
}
|
||||
|
||||
RalewayBold {
|
||||
RalewayRegular {
|
||||
size: 12
|
||||
text: "requires hips"
|
||||
color: hifi.colors.lightGray
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Separator {
|
||||
id: bottomSeperator
|
||||
width: parent.width
|
||||
anchors.top: shoulderConfig.bottom
|
||||
anchors.topMargin: 10
|
||||
}
|
||||
|
||||
|
||||
Rectangle {
|
||||
id: calibrationButton
|
||||
width: 200
|
||||
height: 35
|
||||
radius: 6
|
||||
|
||||
color: hifi.colors.blueHighlight
|
||||
|
||||
anchors.top: bottomSeperator.bottom
|
||||
anchors.topMargin: 10
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: leftMargin
|
||||
|
||||
|
||||
HiFiGlyphs {
|
||||
id: calibrationGlyph
|
||||
text: hifi.glyphs.sliders
|
||||
size: 36
|
||||
color: hifi.colors.white
|
||||
|
||||
anchors.horizontalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 30
|
||||
|
||||
}
|
||||
|
||||
RalewayRegular {
|
||||
id: calibrate
|
||||
text: "CALIBRATE"
|
||||
size: 17
|
||||
color: hifi.colors.white
|
||||
|
||||
anchors.left: calibrationGlyph.right
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 8
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
onClicked: {
|
||||
InputCalibration.calibratePlugin(pluginName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -333,5 +333,6 @@ Item {
|
|||
readonly property string vol_x_2: "\ue015"
|
||||
readonly property string vol_x_3: "\ue016"
|
||||
readonly property string vol_x_4: "\ue017"
|
||||
readonly property string source: "\ue01c"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,3 +48,11 @@ QString InputConfiguration::configurationLayout(QString pluginName) {
|
|||
void InputConfiguration::configurationSettings(QJsonObject configurationSettings, QString pluginName) {
|
||||
qDebug() << configurationSettings["Test"];
|
||||
}
|
||||
|
||||
void InputConfiguration::calibratePlugin(QString pluginName) {
|
||||
for (auto plugin : PluginManager::getInstance()->getInputPlugins()) {
|
||||
if (plugin->getName() == pluginName) {
|
||||
//calibrtate plugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ public:
|
|||
Q_INVOKABLE QStringList activeInputPlugins();
|
||||
Q_INVOKABLE QString configurationLayout(QString pluginName);
|
||||
Q_INVOKABLE void configurationSettings(QJsonObject configurationSettings, QString pluginName);
|
||||
Q_INVOKABLE void calibratePlugin(QString pluginName);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -28,4 +28,6 @@ public:
|
|||
virtual bool isHandController() const = 0;
|
||||
virtual void configurationSettings(const QJsonObject configurationSettings) { }
|
||||
virtual QString configurationLayout() { return QString(); }
|
||||
virtual void calibrate() {}
|
||||
virtual bool configurable() { return false; }
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue