From c33853f4cf9d9f24ef90a2fd9a355a5b6a0c81ea Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Tue, 20 Jun 2017 11:42:42 -0700 Subject: [PATCH] update AvatarInputs with MicBar --- interface/resources/qml/AvatarInputs.qml | 87 +++---------------- interface/resources/qml/hifi/audio/MicBar.qml | 4 +- 2 files changed, 14 insertions(+), 77 deletions(-) diff --git a/interface/resources/qml/AvatarInputs.qml b/interface/resources/qml/AvatarInputs.qml index 28f3c0c7b9..bf70de36fc 100644 --- a/interface/resources/qml/AvatarInputs.qml +++ b/interface/resources/qml/AvatarInputs.qml @@ -12,84 +12,21 @@ import QtQuick.Controls 1.3 import QtGraphicalEffects 1.0 import Qt.labs.settings 1.0 +import "./hifi/audio" as Audio + Hifi.AvatarInputs { - id: root + id: root; objectName: "AvatarInputs" - width: rootWidth - height: controls.height - x: 10; y: 5 + width: audio.width; + height: audio.height; + x: 10; y: 5; - readonly property int rootWidth: 265 - readonly property int iconSize: 24 - readonly property int iconPadding: 5 + readonly property bool shouldReposition: true; - readonly property bool shouldReposition: true - - Settings { - category: "Overlay.AvatarInputs" - property alias x: root.x - property alias y: root.y - } - - MouseArea { - id: hover - hoverEnabled: true - drag.target: parent - anchors.fill: parent - } - - Item { - id: controls - width: root.rootWidth - height: 44 - visible: root.showAudioTools - - Rectangle { - anchors.fill: parent - color: "#00000000" - - Item { - id: audioMeter - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: root.iconPadding - anchors.right: parent.right - anchors.rightMargin: root.iconPadding - height: 8 - Rectangle { - id: blueRect - color: "blue" - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.left: parent.left - width: parent.width / 4 - } - Rectangle { - id: greenRect - color: "green" - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.left: blueRect.right - anchors.right: redRect.left - } - Rectangle { - id: redRect - color: "red" - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.right: parent.right - width: parent.width / 5 - } - Rectangle { - z: 100 - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.right: parent.right - width: (1.0 - root.audioLevel) * parent.width - color: "black" - } - } - } + Audio.MicBar { + id: audio; + visible: root.showAudioTools; + standalone: true; + dragTarget: parent; } } - diff --git a/interface/resources/qml/hifi/audio/MicBar.qml b/interface/resources/qml/hifi/audio/MicBar.qml index 497653a10c..10e12551b7 100644 --- a/interface/resources/qml/hifi/audio/MicBar.qml +++ b/interface/resources/qml/hifi/audio/MicBar.qml @@ -18,6 +18,7 @@ Rectangle { readonly property var level: Audio.inputLevel; property bool standalone: false; + property var dragTarget: null; width: 240; height: 50; @@ -55,10 +56,9 @@ Rectangle { } hoverEnabled: true; - preventStealing: true; - propagateComposedEvents: false; scrollGestureEnabled: false; onClicked: { Audio.muted = !Audio.muted; } + drag.target: dragTarget; } Item {