Fix logic for HMD vs Desktop.

This commit is contained in:
r3tk0n 2019-03-11 09:58:35 -07:00
parent ec0cf3ee3a
commit c1ed01115d

View file

@ -184,18 +184,15 @@ Rectangle {
switchWidth: root.switchWidth; switchWidth: root.switchWidth;
labelTextOn: qsTr("Push To Talk (T)"); labelTextOn: qsTr("Push To Talk (T)");
backgroundOnColor: "#E3E3E3"; backgroundOnColor: "#E3E3E3";
checked: (bar.currentIndex === 1 && isVR) || checked: (bar.currentIndex === 0) ? AudioScriptingInterface.pushToTalkDesktop : AudioScriptingInterface.pushToTalkHMD;
(bar.currentIndex === 0 && !isVR) ? AudioScriptingInterface.pushToTalkDesktop : AudioScriptingInterface.pushToTalkHMD;
onCheckedChanged: { onCheckedChanged: {
if ((bar.currentIndex === 1 && isVR) || if (bar.currentIndex === 0) {
(bar.currentIndex === 0 && !isVR)) {
AudioScriptingInterface.pushToTalkDesktop = checked; AudioScriptingInterface.pushToTalkDesktop = checked;
} else { } else {
AudioScriptingInterface.pushToTalkHMD = checked; AudioScriptingInterface.pushToTalkHMD = checked;
} }
checked = Qt.binding(function() { checked = Qt.binding(function() {
if ((bar.currentIndex === 1 && isVR) || if (bar.currentIndex === 0) {
(bar.currentIndex === 0 && !isVR)) {
return AudioScriptingInterface.pushToTalkDesktop; return AudioScriptingInterface.pushToTalkDesktop;
} else { } else {
return AudioScriptingInterface.pushToTalkHMD; return AudioScriptingInterface.pushToTalkHMD;
@ -218,13 +215,11 @@ Rectangle {
id: pttText id: pttText
color: hifi.colors.white; color: hifi.colors.white;
width: parent.width; width: parent.width;
wrapMode: (bar.currentIndex === 1 && isVR) || wrapMode: (bar.currentIndex === 0) ? Text.NoWrap : Text.WordWrap;
(bar.currentIndex === 0 && !isVR) ? Text.NoWrap : Text.WordWrap;
font.italic: true font.italic: true
size: 16; size: 16;
text: (bar.currentIndex === 1 && isVR) || text: (bar.currentIndex === 0) ? qsTr("Press and hold the button \"T\" to unmute.") :
(bar.currentIndex === 0 && !isVR) ? qsTr("Press and hold the button \"T\" to unmute.") :
qsTr("Press and hold grip triggers on both of your controllers to unmute."); qsTr("Press and hold grip triggers on both of your controllers to unmute.");
onTextChanged: { onTextChanged: {
if (pttTextMetrics.width > pttTextContainer.width) { if (pttTextMetrics.width > pttTextContainer.width) {