From 3bc7baa19a2671e4d03855407c4deceb4be8fa80 Mon Sep 17 00:00:00 2001 From: bbedward Date: Fri, 8 Aug 2025 16:07:26 -0400 Subject: [PATCH] fix cpu burning of privacy indicator --- Modules/TopBar/PrivacyIndicator.qml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Modules/TopBar/PrivacyIndicator.qml b/Modules/TopBar/PrivacyIndicator.qml index f03b4431..3a1ac761 100644 --- a/Modules/TopBar/PrivacyIndicator.qml +++ b/Modules/TopBar/PrivacyIndicator.qml @@ -20,6 +20,7 @@ Rectangle { radius: Theme.cornerRadius visible: hasActivePrivacy opacity: hasActivePrivacy ? 1 : 0 + enabled: hasActivePrivacy color: Qt.rgba( privacyArea.containsMouse ? Theme.errorPressed.r : Theme.errorHover.r, @@ -32,7 +33,8 @@ Rectangle { id: privacyArea anchors.fill: parent - hoverEnabled: true + hoverEnabled: hasActivePrivacy + enabled: hasActivePrivacy cursorShape: Qt.PointingHandCursor onClicked: { @@ -84,7 +86,8 @@ Rectangle { anchors.topMargin: -1 SequentialAnimation on opacity { - running: parent.visible && hasActivePrivacy + id: pulseAnimation + running: parent.visible && hasActivePrivacy && PrivacyService.cameraActive loops: Animation.Infinite NumberAnimation { @@ -116,7 +119,7 @@ Rectangle { } Behavior on width { - enabled: hasActivePrivacy + enabled: hasActivePrivacy && visible NumberAnimation { duration: Theme.mediumDuration easing.type: Theme.emphasizedEasing @@ -148,7 +151,7 @@ Rectangle { } Behavior on opacity { - enabled: hasActivePrivacy + enabled: hasActivePrivacy && root.visible NumberAnimation { duration: Theme.shortDuration easing.type: Theme.standardEasing