1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-07 05:55:37 -05:00

fix cpu burning of privacy indicator

This commit is contained in:
bbedward
2025-08-08 16:07:26 -04:00
parent f5e52c55c0
commit 3bc7baa19a

View File

@@ -20,6 +20,7 @@ Rectangle {
radius: Theme.cornerRadius radius: Theme.cornerRadius
visible: hasActivePrivacy visible: hasActivePrivacy
opacity: hasActivePrivacy ? 1 : 0 opacity: hasActivePrivacy ? 1 : 0
enabled: hasActivePrivacy
color: Qt.rgba( color: Qt.rgba(
privacyArea.containsMouse ? Theme.errorPressed.r : Theme.errorHover.r, privacyArea.containsMouse ? Theme.errorPressed.r : Theme.errorHover.r,
@@ -32,7 +33,8 @@ Rectangle {
id: privacyArea id: privacyArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: hasActivePrivacy
enabled: hasActivePrivacy
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
@@ -84,7 +86,8 @@ Rectangle {
anchors.topMargin: -1 anchors.topMargin: -1
SequentialAnimation on opacity { SequentialAnimation on opacity {
running: parent.visible && hasActivePrivacy id: pulseAnimation
running: parent.visible && hasActivePrivacy && PrivacyService.cameraActive
loops: Animation.Infinite loops: Animation.Infinite
NumberAnimation { NumberAnimation {
@@ -116,7 +119,7 @@ Rectangle {
} }
Behavior on width { Behavior on width {
enabled: hasActivePrivacy enabled: hasActivePrivacy && visible
NumberAnimation { NumberAnimation {
duration: Theme.mediumDuration duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing easing.type: Theme.emphasizedEasing
@@ -148,7 +151,7 @@ Rectangle {
} }
Behavior on opacity { Behavior on opacity {
enabled: hasActivePrivacy enabled: hasActivePrivacy && root.visible
NumberAnimation { NumberAnimation {
duration: Theme.shortDuration duration: Theme.shortDuration
easing.type: Theme.standardEasing easing.type: Theme.standardEasing