mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Merge pull request #21 from wayne-chen/pushToTalk
changing mic bar indicator + PTT setting placement
This commit is contained in:
commit
97e375e004
2 changed files with 32 additions and 36 deletions
|
@ -140,6 +140,29 @@ Rectangle {
|
|||
checked = Qt.binding(function() { return AudioScriptingInterface.isStereoInput; }); // restore binding
|
||||
}
|
||||
}
|
||||
|
||||
HifiControlsUit.Switch {
|
||||
id: pttSwitch
|
||||
height: root.switchHeight;
|
||||
switchWidth: root.switchWidth;
|
||||
labelTextOn: qsTr("Push To Talk (T)");
|
||||
backgroundOnColor: "#E3E3E3";
|
||||
checked: (bar.currentIndex === 0) ? AudioScriptingInterface.pushToTalkDesktop : AudioScriptingInterface.pushToTalkHMD;
|
||||
onCheckedChanged: {
|
||||
if (bar.currentIndex === 0) {
|
||||
AudioScriptingInterface.pushToTalkDesktop = checked;
|
||||
} else {
|
||||
AudioScriptingInterface.pushToTalkHMD = checked;
|
||||
}
|
||||
checked = Qt.binding(function() {
|
||||
if (bar.currentIndex === 0) {
|
||||
return AudioScriptingInterface.pushToTalkDesktop;
|
||||
} else {
|
||||
return AudioScriptingInterface.pushToTalkHMD;
|
||||
}
|
||||
}); // restore binding
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
@ -171,53 +194,26 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
Separator { id: pttStartSeparator; }
|
||||
Item {
|
||||
anchors.left: parent.left
|
||||
width: rightMostInputLevelPos;
|
||||
height: pttSwitch.height + pttText.height + 24;
|
||||
HifiControlsUit.Switch {
|
||||
id: pttSwitch
|
||||
x: 2 * margins.paddings;
|
||||
anchors.top: parent.top;
|
||||
height: root.switchHeight;
|
||||
switchWidth: root.switchWidth;
|
||||
labelTextOn: qsTr("Push To Talk (T)");
|
||||
backgroundOnColor: "#E3E3E3";
|
||||
checked: (bar.currentIndex === 0) ? AudioScriptingInterface.pushToTalkDesktop : AudioScriptingInterface.pushToTalkHMD;
|
||||
onCheckedChanged: {
|
||||
if (bar.currentIndex === 0) {
|
||||
AudioScriptingInterface.pushToTalkDesktop = checked;
|
||||
} else {
|
||||
AudioScriptingInterface.pushToTalkHMD = checked;
|
||||
}
|
||||
checked = Qt.binding(function() {
|
||||
if (bar.currentIndex === 0) {
|
||||
return AudioScriptingInterface.pushToTalkDesktop;
|
||||
} else {
|
||||
return AudioScriptingInterface.pushToTalkHMD;
|
||||
}
|
||||
}); // restore binding
|
||||
}
|
||||
}
|
||||
height: pttText.height;
|
||||
RalewayRegular {
|
||||
id: pttText
|
||||
x: 2 * margins.paddings;
|
||||
x: margins.paddings;
|
||||
color: hifi.colors.white;
|
||||
anchors.bottom: parent.bottom;
|
||||
width: rightMostInputLevelPos;
|
||||
height: paintedHeight;
|
||||
wrapMode: Text.WordWrap;
|
||||
font.italic: true
|
||||
size: 16;
|
||||
|
||||
text: (bar.currentIndex === 0) ? qsTr("Press and hold the button \"T\" to unmute.") :
|
||||
qsTr("Press and hold grip triggers on both of your controllers to unmute.");
|
||||
text: (bar.currentIndex === 0) ? qsTr("Press and hold the button \"T\" to talk.") :
|
||||
qsTr("Press and hold grip triggers on both of your controllers to talk.");
|
||||
}
|
||||
}
|
||||
|
||||
Separator {
|
||||
id: pttEndSeparator;
|
||||
}
|
||||
Separator { }
|
||||
|
||||
|
||||
Item {
|
||||
|
|
|
@ -159,7 +159,7 @@ Rectangle {
|
|||
|
||||
color: parent.color;
|
||||
|
||||
text: (AudioScriptingInterface.pushToTalk && !AudioScriptingInterface.pushingToTalk) ? "MUTED PTT-(T)" : (AudioScriptingInterface.muted ? "MUTED" : "MUTE");
|
||||
text: (AudioScriptingInterface.pushToTalk && !AudioScriptingInterface.pushingToTalk) ? (HMD.active ? "MUTED PTT" : "MUTED PTT-(T)") : (AudioScriptingInterface.muted ? "MUTED" : "MUTE");
|
||||
font.pointSize: 12;
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ Rectangle {
|
|||
verticalCenter: parent.verticalCenter;
|
||||
}
|
||||
|
||||
width: AudioScriptingInterface.pushToTalk && !AudioScriptingInterface.pushingToTalk ? 25 : 50;
|
||||
width: AudioScriptingInterface.pushToTalk && !AudioScriptingInterface.pushingToTalk ? (HMD.active ? 27 : 25) : 50;
|
||||
height: 4;
|
||||
color: parent.color;
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ Rectangle {
|
|||
verticalCenter: parent.verticalCenter;
|
||||
}
|
||||
|
||||
width: AudioScriptingInterface.pushToTalk && !AudioScriptingInterface.pushingToTalk ? 25 : 50;
|
||||
width: AudioScriptingInterface.pushToTalk && !AudioScriptingInterface.pushingToTalk ? (HMD.active ? 27 : 25) : 50;
|
||||
height: 4;
|
||||
color: parent.color;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue