mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 17:41:12 +02:00
update AvatarInputs with MicBar
This commit is contained in:
parent
ab68c44177
commit
c33853f4cf
2 changed files with 14 additions and 77 deletions
|
@ -12,84 +12,21 @@ import QtQuick.Controls 1.3
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
import Qt.labs.settings 1.0
|
import Qt.labs.settings 1.0
|
||||||
|
|
||||||
|
import "./hifi/audio" as Audio
|
||||||
|
|
||||||
Hifi.AvatarInputs {
|
Hifi.AvatarInputs {
|
||||||
id: root
|
id: root;
|
||||||
objectName: "AvatarInputs"
|
objectName: "AvatarInputs"
|
||||||
width: rootWidth
|
width: audio.width;
|
||||||
height: controls.height
|
height: audio.height;
|
||||||
x: 10; y: 5
|
x: 10; y: 5;
|
||||||
|
|
||||||
readonly property int rootWidth: 265
|
readonly property bool shouldReposition: true;
|
||||||
readonly property int iconSize: 24
|
|
||||||
readonly property int iconPadding: 5
|
|
||||||
|
|
||||||
readonly property bool shouldReposition: true
|
Audio.MicBar {
|
||||||
|
id: audio;
|
||||||
Settings {
|
visible: root.showAudioTools;
|
||||||
category: "Overlay.AvatarInputs"
|
standalone: true;
|
||||||
property alias x: root.x
|
dragTarget: parent;
|
||||||
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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ Rectangle {
|
||||||
readonly property var level: Audio.inputLevel;
|
readonly property var level: Audio.inputLevel;
|
||||||
|
|
||||||
property bool standalone: false;
|
property bool standalone: false;
|
||||||
|
property var dragTarget: null;
|
||||||
|
|
||||||
width: 240;
|
width: 240;
|
||||||
height: 50;
|
height: 50;
|
||||||
|
@ -55,10 +56,9 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
hoverEnabled: true;
|
hoverEnabled: true;
|
||||||
preventStealing: true;
|
|
||||||
propagateComposedEvents: false;
|
|
||||||
scrollGestureEnabled: false;
|
scrollGestureEnabled: false;
|
||||||
onClicked: { Audio.muted = !Audio.muted; }
|
onClicked: { Audio.muted = !Audio.muted; }
|
||||||
|
drag.target: dragTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
Loading…
Reference in a new issue