adding working bubble icon

This commit is contained in:
Wayne Chen 2019-02-27 14:54:13 -08:00
parent 915d22bb15
commit 3ceb1598f6
3 changed files with 20 additions and 6 deletions

View file

@ -16,10 +16,10 @@ Item {
id: root;
objectName: "AvatarInputsBar"
property int modality: Qt.NonModal
readonly property bool ignoreRadiusEnabled: AvatarInputs.ignoreRadiusEnabled
width: audio.width;
height: audio.height;
x: 10; y: 5;
readonly property bool shouldReposition: true;
HifiAudio.MicBarApplication {
@ -40,11 +40,10 @@ Item {
}
}
ColorOverlay {
id: bubbleIconOverlay
anchors.fill: bubbleIcon
source: bubbleIcon
color: Users.getIgnoreRadiusEnabled() ? Qt.rgba(31, 198, 166, 0.3) : Qt.rgba(255, 255, 255, 0.3);
onColorChanged: {
console.log("colorChanged")
}
color: AvatarInputs.ignoreRadiusEnabled ? "#1FC6A6" : "#FFFFFF";
opacity: 0.7
}
}

View file

@ -30,6 +30,8 @@ AvatarInputs* AvatarInputs::getInstance() {
AvatarInputs::AvatarInputs(QObject* parent) : QObject(parent) {
_showAudioTools = showAudioToolsSetting.get();
auto nodeList = DependencyManager::get<NodeList>();
connect(nodeList.data(), &NodeList::ignoreRadiusEnabledChanged, this, &AvatarInputs::ignoreRadiusEnabledChanged);
}
#define AI_UPDATE(name, src) \
@ -83,6 +85,10 @@ void AvatarInputs::setShowAudioTools(bool showAudioTools) {
emit showAudioToolsChanged(_showAudioTools);
}
bool AvatarInputs::getIgnoreRadiusEnabled() const {
return DependencyManager::get<NodeList>()->getIgnoreRadiusEnabled();
}
void AvatarInputs::toggleCameraMute() {
FaceTracker* faceTracker = qApp->getSelectedFaceTracker();
if (faceTracker) {

View file

@ -42,6 +42,7 @@ class AvatarInputs : public QObject {
AI_PROPERTY(bool, isHMD, false)
Q_PROPERTY(bool showAudioTools READ showAudioTools WRITE setShowAudioTools NOTIFY showAudioToolsChanged)
Q_PROPERTY(bool ignoreRadiusEnabled READ getIgnoreRadiusEnabled NOTIFY ignoreRadiusEnabledChanged)
public:
static AvatarInputs* getInstance();
@ -55,7 +56,8 @@ public:
AvatarInputs(QObject* parent = nullptr);
void update();
bool showAudioTools() const { return _showAudioTools; }
bool showAudioTools() const { return _showAudioTools; }
bool getIgnoreRadiusEnabled() const;
public slots:
@ -93,6 +95,13 @@ signals:
*/
void showAudioToolsChanged(bool show);
/**jsdoc
* @function AvatarInputs.ignoreRadiusEnabledChanged
* @param {boolean} enabled
* @returns {Signal}
*/
void ignoreRadiusEnabledChanged(bool enabled);
protected:
/**jsdoc