fixed merge conficts

This commit is contained in:
Dante Ruiz 2017-06-21 16:59:53 +01:00
commit 729065749f
3 changed files with 155 additions and 29 deletions

View file

@ -23,6 +23,7 @@ Original.CheckBox {
property bool isRedCheck: false property bool isRedCheck: false
property int boxSize: 14 property int boxSize: 14
property int boxRadius: 3 property int boxRadius: 3
property bool wrap: true;
readonly property int checkSize: Math.max(boxSize - 8, 10) readonly property int checkSize: Math.max(boxSize - 8, 10)
readonly property int checkRadius: 2 readonly property int checkRadius: 2
activeFocusOnPress: true activeFocusOnPress: true
@ -92,7 +93,8 @@ Original.CheckBox {
text: control.text text: control.text
color: control.color color: control.color
x: 2 x: 2
wrapMode: Text.Wrap wrapMode: checkBox.wrap ? Text.Wrap : Text.NoWrap
elide: checkBox.wrap ? Text.ElideNone : Text.ElideRight
enabled: checkBox.enabled enabled: checkBox.enabled
} }
} }

View file

@ -52,34 +52,40 @@ Rectangle {
Separator { visible: root.showTitle() } Separator { visible: root.showTitle() }
Grid { ColumnLayout {
columns: 2;
x: 16; // padding does not work x: 16; // padding does not work
spacing: 16; spacing: 16;
AudioControls.CheckBox { // mute is in its own row
text: qsTr("Mute microphone"); RowLayout {
isRedCheck: true; AudioControls.CheckBox {
checked: Audio.muted; text: qsTr("Mute microphone");
onClicked: { isRedCheck: true;
Audio.muted = checked; checked: Audio.muted;
checked = Qt.binding(function() { return Audio.muted; }); // restore binding onClicked: {
Audio.muted = checked;
checked = Qt.binding(function() { return Audio.muted; }); // restore binding
}
} }
} }
AudioControls.CheckBox {
text: qsTr("Enable noise reduction"); RowLayout {
checked: Audio.noiseReduction; spacing: 16;
onClicked: { AudioControls.CheckBox {
Audio.noiseReduction = checked; text: qsTr("Enable noise reduction");
checked = Qt.binding(function() { return Audio.noiseReduction; }); // restore binding checked: Audio.noiseReduction;
onClicked: {
Audio.noiseReduction = checked;
checked = Qt.binding(function() { return Audio.noiseReduction; }); // restore binding
}
} }
} AudioControls.CheckBox {
AudioControls.CheckBox { text: qsTr("Show audio level meter");
text: qsTr("Show audio level meter"); checked: AvatarInputs.showAudioTools;
checked: AvatarInputs.showAudioTools; onClicked: {
onClicked: { AvatarInputs.showAudioTools = checked;
AvatarInputs.showAudioTools = checked; checked = Qt.binding(function() { return AvatarInputs.showAudioTools; }); // restore binding
checked = Qt.binding(function() { return AvatarInputs.showAudioTools; }); // restore binding }
} }
} }
} }
@ -111,12 +117,25 @@ Rectangle {
delegate: Item { delegate: Item {
width: parent.width; width: parent.width;
height: 36; height: 36;
AudioControls.CheckBox {
text: display; RowLayout {
checked: selected; width: parent.width;
onClicked: {
selected = checked; AudioControls.CheckBox {
checked = Qt.binding(function() { return selected; }); // restore binding Layout.maximumWidth: parent.width - level.width - 40;
text: display;
wrap: false;
checked: selected;
onClicked: {
selected = checked;
checked = Qt.binding(function() { return selected; }); // restore binding
}
}
InputLevel {
id: level;
Layout.alignment: Qt.AlignRight;
Layout.rightMargin: 30;
visible: selected;
} }
} }
} }

View file

@ -0,0 +1,105 @@
//
// InputLevel.qml
// qml/hifi/audio
//
// Created by Zach Pomerantz on 6/20/2017
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
Rectangle {
readonly property var level: Audio.inputLevel;
width: 70;
height: 8;
color: "transparent";
Item {
id: colors;
readonly property string muted: "#E2334D";
readonly property string gutter: "#575757";
readonly property string greenStart: "#39A38F";
readonly property string greenEnd: "#1FC6A6";
readonly property string red: colors.muted;
}
Text {
id: status;
anchors {
horizontalCenter: parent.horizontalCenter;
verticalCenter: parent.verticalCenter;
}
visible: Audio.muted;
color: colors.muted;
text: "MUTED";
font.pointSize: 10;
}
Item {
id: bar;
width: parent.width;
height: parent.height;
anchors { fill: parent }
visible: !status.visible;
Rectangle { // base
radius: 4;
anchors { fill: parent }
color: colors.gutter;
}
Rectangle { // mask
id: mask;
width: parent.width * level;
radius: 5;
anchors {
bottom: parent.bottom;
bottomMargin: 0;
top: parent.top;
topMargin: 0;
left: parent.left;
leftMargin: 0;
}
}
LinearGradient {
anchors { fill: mask }
source: mask
start: Qt.point(0, 0);
end: Qt.point(70, 0);
gradient: Gradient {
GradientStop {
position: 0;
color: colors.greenStart;
}
GradientStop {
position: 0.8;
color: colors.greenEnd;
}
GradientStop {
position: 0.801;
color: colors.red;
}
GradientStop {
position: 1;
color: colors.red;
}
}
}
}
}