separating out bubble icon qml - adding support for transparency

This commit is contained in:
Wayne Chen 2019-03-14 10:28:18 -07:00
parent 8e6913dde1
commit d0116abc52
5 changed files with 13 additions and 69 deletions

View file

@ -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;

View file

@ -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";

View file

@ -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<KeyboardScriptingInterface>();
DependencyManager::set<GrabManager>();
DependencyManager::set<AvatarPackager>();
DependencyManager::set<PrivacyShield>();
return previousSessionCrashed;
}
@ -2672,9 +2670,6 @@ void Application::cleanupBeforeQuit() {
nodeList->getPacketReceiver().setShouldDropPackets(true);
}
// destroy privacy shield before entity shutdown.
DependencyManager::get<PrivacyShield>()->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<PickManager>();
DependencyManager::destroy<KeyboardScriptingInterface>();
DependencyManager::destroy<Keyboard>();
DependencyManager::destroy<PrivacyShield>();
DependencyManager::destroy<AvatarPackager>();
qCDebug(interfaceapp) << "Application::cleanupBeforeQuit() complete";
@ -5555,8 +5549,6 @@ void Application::resumeAfterLoginDialogActionTaken() {
menu->getMenu("Developer")->setVisible(_developerMenuVisible);
_myCamera.setMode(_previousCameraMode);
cameraModeChanged();
DependencyManager::get<PrivacyShield>()->createPrivacyShield();
}
void Application::loadAvatarScripts(const QVector<QString>& urls) {
@ -6515,8 +6507,6 @@ void Application::update(float deltaTime) {
updateLoginDialogPosition();
}
DependencyManager::get<PrivacyShield>()->update(deltaTime);
{
PROFILE_RANGE_EX(app, "Overlays", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
PerformanceTimer perfTimer("overlays");

View file

@ -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 <QtCore/QObject>
#include <QtCore/QUuid>
#include <QtGlobal>
#include <DependencyManager.h>
#include <Sound.h>
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 };
};

View file

@ -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",