mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
feat(notifications): focus sender window on click in notification history
This commit is contained in:
@@ -560,6 +560,7 @@ SmartPanel {
|
||||
|
||||
property int listIndex: index
|
||||
property string notificationId: model.id
|
||||
property string appName: model.appName || ""
|
||||
property bool isExpanded: scrollView.expandedId === notificationId
|
||||
property bool canExpand: summaryText.truncated || bodyText.truncated
|
||||
property real swipeOffset: 0
|
||||
@@ -775,6 +776,17 @@ SmartPanel {
|
||||
notificationDelegate.pendingLink = "";
|
||||
return;
|
||||
}
|
||||
|
||||
// Focus sender window (and invoke default action if available)
|
||||
var actions = notificationDelegate.actionsList;
|
||||
var hasDefault = actions.some(function(a) { return a.identifier === "default"; });
|
||||
if (hasDefault) {
|
||||
NotificationService.focusSenderWindow(notificationDelegate.appName);
|
||||
NotificationService.invokeAction(notificationDelegate.notificationId, "default");
|
||||
} else {
|
||||
NotificationService.focusSenderWindow(notificationDelegate.appName);
|
||||
}
|
||||
root.close();
|
||||
}
|
||||
onCanceled: {
|
||||
notificationDelegate.isSwiping = false;
|
||||
@@ -932,7 +944,9 @@ SmartPanel {
|
||||
// Capture modelData in a property to avoid reference errors
|
||||
property var actionData: modelData
|
||||
onClicked: {
|
||||
NotificationService.focusSenderWindow(notificationDelegate.appName);
|
||||
NotificationService.invokeAction(notificationDelegate.notificationId, actionData.identifier);
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user