mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 04:59:54 +02:00
switch from column layout to item
This commit is contained in:
parent
04c6c42512
commit
2eaa1e63d3
1 changed files with 8 additions and 66 deletions
|
@ -166,10 +166,12 @@ Rectangle {
|
||||||
|
|
||||||
Separator {}
|
Separator {}
|
||||||
|
|
||||||
ColumnLayout {
|
Item {
|
||||||
spacing: muteMic.spacing;
|
width: rightMostInputLevelPos
|
||||||
|
height: pttTextContainer.height + pttCheckBox.height + margins.paddings + 10
|
||||||
AudioControls.CheckBox {
|
AudioControls.CheckBox {
|
||||||
spacing: muteMic.spacing
|
id: pttCheckBox
|
||||||
|
anchors.top: parent.top
|
||||||
text: qsTr("Push To Talk (T)");
|
text: qsTr("Push To Talk (T)");
|
||||||
checked: isVR ? AudioScriptingInterface.pushToTalkHMD : AudioScriptingInterface.pushToTalkDesktop;
|
checked: isVR ? AudioScriptingInterface.pushToTalkHMD : AudioScriptingInterface.pushToTalkDesktop;
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@ -189,69 +191,9 @@ Rectangle {
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
id: pttTextContainer
|
id: pttTextContainer
|
||||||
x: margins.paddings;
|
anchors.top: pttCheckBox.bottom
|
||||||
width: rightMostInputLevelPos
|
anchors.topMargin: 10
|
||||||
height: pttTextMetrics.height
|
width: parent.width
|
||||||
visible: true
|
|
||||||
TextMetrics {
|
|
||||||
id: pttTextMetrics
|
|
||||||
text: pttText.text
|
|
||||||
font: pttText.font
|
|
||||||
}
|
|
||||||
RalewayRegular {
|
|
||||||
id: pttText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: hifi.colors.white;
|
|
||||||
width: parent.width;
|
|
||||||
font.italic: true
|
|
||||||
size: 16;
|
|
||||||
text: isVR ? qsTr("Press and hold grip triggers on both of your controllers to unmute.") :
|
|
||||||
qsTr("Press and hold the button \"T\" to unmute.");
|
|
||||||
onTextChanged: {
|
|
||||||
if (pttTextMetrics.width > rightMostInputLevelPos) {
|
|
||||||
pttTextContainer.height = Math.ceil(pttTextMetrics.width / rightMostInputLevelPos) * pttTextMetrics.height;
|
|
||||||
} else {
|
|
||||||
pttTextContainer.height = pttTextMetrics.height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (pttTextMetrics.width > rightMostInputLevelPos) {
|
|
||||||
pttTextContainer.height = Math.ceil(pttTextMetrics.width / rightMostInputLevelPos) * pttTextMetrics.height;
|
|
||||||
} else {
|
|
||||||
pttTextContainer.height = pttTextMetrics.height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Separator {}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
spacing: muteMic.spacing;
|
|
||||||
AudioControls.CheckBox {
|
|
||||||
spacing: muteMic.spacing
|
|
||||||
text: qsTr("Push To Talk (T)");
|
|
||||||
checked: isVR ? AudioScriptingInterface.pushToTalkHMD : AudioScriptingInterface.pushToTalkDesktop;
|
|
||||||
onClicked: {
|
|
||||||
if (isVR) {
|
|
||||||
AudioScriptingInterface.pushToTalkHMD = checked;
|
|
||||||
} else {
|
|
||||||
AudioScriptingInterface.pushToTalkDesktop = checked;
|
|
||||||
}
|
|
||||||
checked = Qt.binding(function() {
|
|
||||||
if (isVR) {
|
|
||||||
return AudioScriptingInterface.pushToTalkHMD;
|
|
||||||
} else {
|
|
||||||
return AudioScriptingInterface.pushToTalkDesktop;
|
|
||||||
}
|
|
||||||
}); // restore binding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Item {
|
|
||||||
id: pttTextContainer
|
|
||||||
x: margins.paddings;
|
|
||||||
width: rightMostInputLevelPos
|
|
||||||
height: pttTextMetrics.height
|
height: pttTextMetrics.height
|
||||||
visible: true
|
visible: true
|
||||||
TextMetrics {
|
TextMetrics {
|
||||||
|
|
Loading…
Reference in a new issue