changing opacity

This commit is contained in:
Wayne Chen 2019-03-28 16:19:35 -07:00
parent 8627a92f29
commit f2b0e47c39
2 changed files with 8 additions and 8 deletions

View file

@ -24,9 +24,9 @@ Rectangle {
function updateOpacity() { function updateOpacity() {
if (ignoreRadiusEnabled) { if (ignoreRadiusEnabled) {
bubbleRect.opacity = 0.7; bubbleRect.opacity = 1.0;
} else { } else {
bubbleRect.opacity = 0.3; bubbleRect.opacity = 0.7;
} }
} }
@ -74,7 +74,7 @@ Rectangle {
} }
drag.target: dragTarget; drag.target: dragTarget;
onContainsMouseChanged: { onContainsMouseChanged: {
var rectOpacity = ignoreRadiusEnabled ? (containsMouse ? 0.9 : 0.7) : (containsMouse ? 0.5 : 0.3); var rectOpacity = (ignoreRadiusEnabled && containsMouse) ? 1.0 : (containsMouse ? 1.0 : 0.7);
if (containsMouse) { if (containsMouse) {
Tablet.playSound(TabletEnums.ButtonHover); Tablet.playSound(TabletEnums.ButtonHover);
} }

View file

@ -51,14 +51,14 @@ Rectangle {
height: 44; height: 44;
radius: 5; radius: 5;
opacity: 0.7 opacity: 0.7;
onLevelChanged: { onLevelChanged: {
var rectOpacity = muted && (level >= userSpeakingLevel) ? 0.9 : 0.3; var rectOpacity = muted && (level >= userSpeakingLevel) ? 1.0 : 0.7;
if (pushToTalk && !pushingToTalk) { if (pushToTalk && !pushingToTalk) {
rectOpacity = (level >= userSpeakingLevel) ? 0.9 : 0.7; rectOpacity = (level >= userSpeakingLevel) ? 1.0 : 0.7;
} else if (mouseArea.containsMouse && rectOpacity != 0.9) { } else if (mouseArea.containsMouse && rectOpacity != 1.0) {
rectOpacity = 0.5; rectOpacity = 1.0;
} }
micBar.opacity = rectOpacity; micBar.opacity = rectOpacity;
} }