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

View file

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

View file

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