notifs: invoke action on click if only single action

This commit is contained in:
2 * r + 2 * t 2025-05-10 21:43:23 +10:00
parent ae67668fc2
commit 0b0657314f
2 changed files with 6 additions and 0 deletions

View file

@ -57,6 +57,11 @@ StyledRect {
root.expanded = diffY > 0;
}
}
onClicked: {
const actions = root.modelData.actions;
if (actions.length === 1)
root.modelData.actions[0].invoke();
}
}
Behavior on x {

View file

@ -55,6 +55,7 @@ Singleton {
readonly property string appIcon: notification.appIcon
readonly property string appName: notification.appName
readonly property string image: notification.image
readonly property list<NotificationAction> actions: notification.actions
readonly property Timer timer: Timer {
running: true