diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-10 21:43:23 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-10 21:43:23 +1000 |
| commit | 0b0657314f81c58ed3a2e2499cc905605a979d4e (patch) | |
| tree | a94058f02df507a8df2165e175fadc11abfbc075 | |
| parent | notifs: option to have expire timeout (diff) | |
| download | caelestia-shell-0b0657314f81c58ed3a2e2499cc905605a979d4e.tar.gz caelestia-shell-0b0657314f81c58ed3a2e2499cc905605a979d4e.tar.bz2 caelestia-shell-0b0657314f81c58ed3a2e2499cc905605a979d4e.zip | |
notifs: invoke action on click if only single action
| -rw-r--r-- | modules/notifications/Notification.qml | 5 | ||||
| -rw-r--r-- | services/Notifs.qml | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/modules/notifications/Notification.qml b/modules/notifications/Notification.qml index a02210e..76274e0 100644 --- a/modules/notifications/Notification.qml +++ b/modules/notifications/Notification.qml @@ -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 { diff --git a/services/Notifs.qml b/services/Notifs.qml index 44db1c5..4d1f986 100644 --- a/services/Notifs.qml +++ b/services/Notifs.qml @@ -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 |