Feat: Now freezes the notifications when hovering on notifications buttons too.

This commit is contained in:
amadoabad
2025-10-17 02:12:21 +03:00
parent b0f6f22b2d
commit 957dede6b3
2 changed files with 31 additions and 8 deletions
+27 -8
View File
@@ -248,24 +248,40 @@ Variants {
// Staggered animation delay based on index
readonly property int animationDelay: index * 100
property int hoverCount: 0
onHoverCountChanged: {
if (hoverCount > 0) {
resumeTimer.stop()
NotificationService.pauseTimeout(notificationId)
} else {
resumeTimer.start()
}
}
Timer {
id: resumeTimer
interval: 50
repeat: false
onTriggered: {
if (hoverCount === 0) {
NotificationService.resumeTimeout(notificationId)
}
}
}
// Right-click to dismiss
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
hoverEnabled: true
onEntered: parent.hoverCount++
onExited: parent.hoverCount--
onClicked: {
if (mouse.button === Qt.RightButton) {
animateOut()
}
}
onContainsMouseChanged: {
if (containsMouse) {
NotificationService.pauseTimeout(notificationId)
} else {
NotificationService.resumeTimeout(notificationId)
}
}
}
// Scale, fade, and slide animation
@@ -493,6 +509,9 @@ Variants {
delegate: NButton {
property var actionData: modelData
onEntered: card.hoverCount++
onExited: card.hoverCount--
text: {
var actionText = actionData.text || "Open"
// If text contains comma, take the part after the comma (the display text)