Merge pull request #13298 from danteruiz/fix-vive-configuration-page

Controller Confguration Page fixes
This commit is contained in:
John Conklin II 2018-06-14 11:07:26 -07:00 committed by GitHub
commit 7057e00583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1111 additions and 1082 deletions

View file

@ -171,6 +171,10 @@ FocusScope {
} }
} }
function textAt(index) {
return comboBox.textAt(index);
}
HifiControls.Label { HifiControls.Label {
id: comboBoxLabel id: comboBoxLabel
text: root.label text: root.label

View file

@ -69,10 +69,15 @@ Item {
id: stack id: stack
initialItem: inputConfiguration initialItem: inputConfiguration
property alias messageVisible: imageMessageBox.visible property alias messageVisible: imageMessageBox.visible
property alias selectedPlugin: box.currentText
Rectangle { Rectangle {
id: inputConfiguration id: inputConfiguration
anchors.fill: parent anchors {
top: parent.top
left: parent.left
right: parent.right
}
height: 230
HifiConstants { id: hifi } HifiConstants { id: hifi }
@ -168,7 +173,7 @@ Item {
text: "show all input devices" text: "show all input devices"
onClicked: { onClicked: {
inputPlugins(); box.model = inputPlugins();
changeSource(); changeSource();
} }
} }
@ -208,25 +213,28 @@ Item {
anchors.leftMargin: 10 anchors.leftMargin: 10
anchors.topMargin: 30 anchors.topMargin: 30
} }
}
Rectangle {
id: loaderRectangle
z: -1
color: hifi.colors.baseGray
width: parent.width
anchors.left: parent.left
anchors.right: parent.right
anchors.top: inputConfiguration.bottom
anchors.bottom: parent.bottom
Loader { Loader {
id: loader id: loader
asynchronous: false asynchronous: false
anchors.fill: parent
width: inputConfiguration.width source: InputConfiguration.configurationLayout(box.textAt(box.currentIndex));
anchors.left: inputConfiguration.left
anchors.right: inputConfiguration.right
anchors.top: configurationHeader.bottom
anchors.topMargin: 10
anchors.bottom: inputConfiguration.bottom
source: InputConfiguration.configurationLayout(box.currentText);
onLoaded: { onLoaded: {
if (loader.item.hasOwnProperty("pluginName")) { if (loader.item.hasOwnProperty("pluginName")) {
if (box.currentText === "HTC Vive") { if (box.textAt(box.currentIndex) === "HTC Vive") {
loader.item.pluginName = "OpenVR"; loader.item.pluginName = "OpenVR";
} else { } else {
loader.item.pluginName = box.currentText; loader.item.pluginName = box.textAt(box.currentIndex);
} }
} }
@ -252,11 +260,12 @@ Item {
function changeSource() { function changeSource() {
loader.source = ""; loader.source = "";
var selectedDevice = box.textAt(box.currentIndex);
var source = ""; var source = "";
if (box.currentText == "Vive") { if (selectedDevice == "HTC Vive") {
source = InputConfiguration.configurationLayout("OpenVR"); source = InputConfiguration.configurationLayout("OpenVR");
} else { } else {
source = InputConfiguration.configurationLayout(box.currentText); source = InputConfiguration.configurationLayout(selectedDevice);
} }
loader.source = source; loader.source = source;

File diff suppressed because it is too large Load diff