From 8aedc98a584870156998ba615bd935511621e147 Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Mon, 11 Mar 2019 10:54:48 -0700 Subject: [PATCH] Fix QML formatting issue. --- interface/resources/qml/hifi/audio/Audio.qml | 57 ++++++++------------ 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index ecc3297d9f..5e849acedf 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -171,15 +171,14 @@ Rectangle { } } - Separator {} - - - ColumnLayout { - id: pttColumn - spacing: 24; - x: 2 * margins.paddings; + Separator { id: pttStartSeparator; } + Item { + 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)"); @@ -200,39 +199,25 @@ Rectangle { }); // restore binding } } - Item { - id: pttTextContainer - width: rightMostInputLevelPos - height: pttTextMetrics.height - anchors.left: parent.left - anchors.leftMargin: -margins.padding - TextMetrics { - id: pttTextMetrics - text: pttText.text - font: pttText.font - } - RalewayRegular { - id: pttText - color: hifi.colors.white; - width: parent.width; - wrapMode: (bar.currentIndex === 0) ? Text.NoWrap : Text.WordWrap; - font.italic: true - size: 16; + RalewayRegular { + id: pttText + x: 2 * 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."); - onTextChanged: { - if (pttTextMetrics.width > pttTextContainer.width) { - pttTextContainer.height = Math.ceil(pttTextMetrics.width / pttTextContainer.width) * pttTextMetrics.height; - } else { - pttTextContainer.height = pttTextMetrics.height; - } - } - } + 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."); } } - Separator {} + Separator { + id: pttEndSeparator; + } Item {