From d0116abc5271fccc15ae8e6f9371faf92120332c Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 14 Mar 2019 10:28:18 -0700 Subject: [PATCH] separating out bubble icon qml - adding support for transparency --- interface/resources/qml/hifi/audio/MicBar.qml | 16 +++---- .../qml/hifi/audio/MicBarApplication.qml | 6 ++- interface/src/Application.cpp | 10 ---- interface/src/ui/PrivacyShield.h | 47 ------------------- scripts/defaultScripts.js | 3 +- 5 files changed, 13 insertions(+), 69 deletions(-) delete mode 100644 interface/src/ui/PrivacyShield.h diff --git a/interface/resources/qml/hifi/audio/MicBar.qml b/interface/resources/qml/hifi/audio/MicBar.qml index cad64b9b74..fb52f8bc5e 100644 --- a/interface/resources/qml/hifi/audio/MicBar.qml +++ b/interface/resources/qml/hifi/audio/MicBar.qml @@ -30,7 +30,7 @@ Rectangle { AudioScriptingInterface.noiseGateOpened.connect(function() { gated = false; }); AudioScriptingInterface.noiseGateClosed.connect(function() { gated = true; }); } - + property bool standalone: false; property var dragTarget: null; @@ -146,7 +146,7 @@ Rectangle { Item { id: status; - readonly property string color: AudioScriptingInterface.muted ? colors.muted : colors.unmuted; + readonly property string color: muted ? colors.muted : colors.unmuted; visible: (pushToTalk && !pushingToTalk) || (muted && (level >= userSpeakingLevel)); @@ -243,12 +243,12 @@ Rectangle { } } } - + Rectangle { id: gatedIndicator; visible: gated && !AudioScriptingInterface.clipping - - radius: 4; + + radius: 4; width: 2 * radius; height: 2 * radius; color: "#0080FF"; @@ -257,12 +257,12 @@ Rectangle { verticalCenter: parent.verticalCenter; } } - + Rectangle { id: clippingIndicator; visible: AudioScriptingInterface.clipping - - radius: 4; + + radius: 4; width: 2 * radius; height: 2 * radius; color: colors.red; diff --git a/interface/resources/qml/hifi/audio/MicBarApplication.qml b/interface/resources/qml/hifi/audio/MicBarApplication.qml index 812e581fe1..f2839aee1a 100644 --- a/interface/resources/qml/hifi/audio/MicBarApplication.qml +++ b/interface/resources/qml/hifi/audio/MicBarApplication.qml @@ -55,10 +55,12 @@ Rectangle { onLevelChanged: { var rectOpacity = muted && (level >= userSpeakingLevel) ? 0.9 : 0.3; - if (mouseArea.containsMouse && rectOpacity != 0.9) { + if (pushToTalk && !pushingToTalk) { + rectOpacity = (level >= userSpeakingLevel) ? 0.9 : 0.7; + } else if (mouseArea.containsMouse && rectOpacity != 0.9) { rectOpacity = 0.5; } - opacity = rectOpacity; + micBar.opacity = rectOpacity; } color: "#00000000"; diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index bd8107793a..9fd0781eef 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -211,7 +211,6 @@ #include "ui/UpdateDialog.h" #include "ui/DomainConnectionModel.h" #include "ui/Keyboard.h" -#include "ui/PrivacyShield.h" #include "Util.h" #include "InterfaceParentFinder.h" #include "ui/OctreeStatsProvider.h" @@ -932,7 +931,6 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { DependencyManager::set(); DependencyManager::set(); DependencyManager::set(); - DependencyManager::set(); return previousSessionCrashed; } @@ -2672,9 +2670,6 @@ void Application::cleanupBeforeQuit() { nodeList->getPacketReceiver().setShouldDropPackets(true); } - // destroy privacy shield before entity shutdown. - DependencyManager::get()->destroyPrivacyShield(); - getEntities()->shutdown(); // tell the entities system we're shutting down, so it will stop running scripts // Clear any queued processing (I/O, FBX/OBJ/Texture parsing) @@ -2753,7 +2748,6 @@ void Application::cleanupBeforeQuit() { DependencyManager::destroy(); DependencyManager::destroy(); DependencyManager::destroy(); - DependencyManager::destroy(); DependencyManager::destroy(); qCDebug(interfaceapp) << "Application::cleanupBeforeQuit() complete"; @@ -5555,8 +5549,6 @@ void Application::resumeAfterLoginDialogActionTaken() { menu->getMenu("Developer")->setVisible(_developerMenuVisible); _myCamera.setMode(_previousCameraMode); cameraModeChanged(); - - DependencyManager::get()->createPrivacyShield(); } void Application::loadAvatarScripts(const QVector& urls) { @@ -6515,8 +6507,6 @@ void Application::update(float deltaTime) { updateLoginDialogPosition(); } - DependencyManager::get()->update(deltaTime); - { PROFILE_RANGE_EX(app, "Overlays", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount()); PerformanceTimer perfTimer("overlays"); diff --git a/interface/src/ui/PrivacyShield.h b/interface/src/ui/PrivacyShield.h deleted file mode 100644 index 5aecb661f7..0000000000 --- a/interface/src/ui/PrivacyShield.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// PrivacyShield.h -// interface/src/ui -// -// Created by Wayne Chen on 2/27/19. -// Copyright 2019 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 -// - -#pragma once - -#include -#include -#include - -#include -#include - -class PrivacyShield : public QObject, public Dependency { - Q_OBJECT - SINGLETON_DEPENDENCY - -public: - PrivacyShield(); - void createPrivacyShield(); - void destroyPrivacyShield(); - - bool isVisible() const { return _visible; } - void update(float deltaTime); - -protected slots: - void enteredIgnoreRadius(); - void onPrivacyShieldToggled(bool enabled, bool doNotLog = false); - -private: - void showPrivacyShield(); - void hidePrivacyShield(); - - SharedSoundPointer _bubbleActivateSound; - QUuid _localPrivacyShieldID; - quint64 _privacyShieldTimestamp; - quint64 _lastPrivacyShieldSoundTimestamp; - bool _visible { false }; - bool _updateConnected { false }; -}; diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 0d9799a035..bd7e79dffc 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -32,8 +32,7 @@ var DEFAULT_SCRIPTS_COMBINED = [ "system/firstPersonHMD.js", "system/tablet-ui/tabletUI.js", "system/emote.js", - "system/miniTablet.js", - "system/createAvatarInputsBarEntity.js" + "system/miniTablet.js" ]; var DEFAULT_SCRIPTS_SEPARATE = [ "system/controllers/controllerScripts.js",