mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 09:17:29 +02:00
adding proper logic for shield icon behavior
This commit is contained in:
parent
d8ba08ec2d
commit
389667ae56
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue