mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
notification: fixed warning introduced by previous "close on LMB"
This commit is contained in:
@@ -303,20 +303,20 @@ Variants {
|
||||
hoverEnabled: true
|
||||
onEntered: card.hoverCount++
|
||||
onExited: card.hoverCount--
|
||||
onClicked: {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
animateOut();
|
||||
} else if (mouse.button === Qt.LeftButton) {
|
||||
var actions = model.actionsJson ? JSON.parse(model.actionsJson) : [];
|
||||
var hasDefault = actions.some(function (a) {
|
||||
return a.identifier === "default";
|
||||
});
|
||||
if (hasDefault) {
|
||||
NotificationService.invokeAction(notificationId, "default");
|
||||
animateOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
card.animateOut();
|
||||
} else if (mouse.button === Qt.LeftButton) {
|
||||
var actions = model.actionsJson ? JSON.parse(model.actionsJson) : [];
|
||||
var hasDefault = actions.some(function (a) {
|
||||
return a.identifier === "default";
|
||||
});
|
||||
if (hasDefault) {
|
||||
NotificationService.invokeAction(notificationId, "default");
|
||||
card.animateOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Animation setup
|
||||
function triggerEntryAnimation() {
|
||||
|
||||
@@ -809,6 +809,13 @@ Singleton {
|
||||
} else if (!notifData.notification) {
|
||||
// No notification object
|
||||
} else {
|
||||
// Disconnect closed signal before invoking so the app-triggered close
|
||||
// doesn't immediately remove the delegate (the dismiss animation handles removal)
|
||||
if (notifData.onClosed) {
|
||||
notifData.notification.closed.disconnect(notifData.onClosed);
|
||||
notifData.onClosed = null;
|
||||
}
|
||||
|
||||
// Use cached actions if live actions are empty (which happens if app closed notification)
|
||||
const actionsToUse = (notifData.notification.actions && notifData.notification.actions.length > 0) ? notifData.notification.actions : (notifData.cachedActions || []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user