Merge pull request #15409 from wayne-chen/fixShieldIconBehavior

Case 22290: Fixing Shield Icon Behavior in Desktop Mode
This commit is contained in:
Shannon Romano 2019-04-24 16:35:02 -07:00 committed by GitHub
commit 404be42bfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,15 +23,15 @@ Rectangle {
property bool ignoreRadiusEnabled: AvatarInputs.ignoreRadiusEnabled; property bool ignoreRadiusEnabled: AvatarInputs.ignoreRadiusEnabled;
function updateOpacity() { function updateOpacity() {
if (ignoreRadiusEnabled) { var rectOpacity = ignoreRadiusEnabled ? 1.0 : (mouseArea.containsMouse ? 1.0 : 0.7);
bubbleRect.opacity = 1.0; bubbleRect.opacity = rectOpacity;
} else {
bubbleRect.opacity = 0.7;
}
} }
Component.onCompleted: { Component.onCompleted: {
updateOpacity(); updateOpacity();
AvatarInputs.ignoreRadiusEnabledChanged.connect(function() {
ignoreRadiusEnabled = AvatarInputs.ignoreRadiusEnabled;
});
} }
onIgnoreRadiusEnabledChanged: { onIgnoreRadiusEnabledChanged: {
@ -74,10 +74,10 @@ Rectangle {
} }
drag.target: dragTarget; drag.target: dragTarget;
onContainsMouseChanged: { onContainsMouseChanged: {
var rectOpacity = (ignoreRadiusEnabled && containsMouse) ? 1.0 : (containsMouse ? 1.0 : 0.7);
if (containsMouse) { if (containsMouse) {
Tablet.playSound(TabletEnums.ButtonHover); Tablet.playSound(TabletEnums.ButtonHover);
} }
var rectOpacity = ignoreRadiusEnabled ? 1.0 : (mouseArea.containsMouse ? 1.0 : 0.7);
bubbleRect.opacity = rectOpacity; bubbleRect.opacity = rectOpacity;
} }
} }