mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-06 23:39:27 -05:00
notifications: hover prevents timeout
This commit is contained in:
@@ -10,7 +10,7 @@ import Quickshell
|
||||
* A group of notifications from the same app.
|
||||
* Similar to Android's notifications
|
||||
*/
|
||||
Item { // Notification group area
|
||||
MouseArea { // Notification group area
|
||||
id: root
|
||||
property var notificationGroup
|
||||
property var notifications: notificationGroup?.notifications ?? []
|
||||
@@ -38,6 +38,17 @@ Item { // Notification group area
|
||||
destroyAnimation.running = true;
|
||||
}
|
||||
|
||||
hoverEnabled: true
|
||||
onContainsMouseChanged: {
|
||||
if (!root.popup) return;
|
||||
if (root.containsMouse) root.notifications.forEach(notif => {
|
||||
Notifications.cancelTimeout(notif.notificationId);
|
||||
});
|
||||
else root.notifications.forEach(notif => {
|
||||
Notifications.timeoutNotification(notif.notificationId);
|
||||
});
|
||||
}
|
||||
|
||||
SequentialAnimation { // Drag finish animation
|
||||
id: destroyAnimation
|
||||
running: false
|
||||
|
||||
@@ -204,6 +204,12 @@ Singleton {
|
||||
root.discardAll();
|
||||
}
|
||||
|
||||
function cancelTimeout(id) {
|
||||
const index = root.list.findIndex((notif) => notif.notificationId === id);
|
||||
if (root.list[index] != null)
|
||||
root.list[index].timer.stop();
|
||||
}
|
||||
|
||||
function timeoutNotification(id) {
|
||||
const index = root.list.findIndex((notif) => notif.notificationId === id);
|
||||
if (root.list[index] != null)
|
||||
|
||||
Reference in New Issue
Block a user