From 9dfb195913a0062a7d493d0128ebd50d86b5e493 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 19 Sep 2025 22:43:50 +1000 Subject: sidebar/notifs: add actions (#648) * add actions (not done, transfer between machines) * notifs: fix persistence * notifs: persist actions (appearance only) * sidebar/notifs: add actions * sidebar/notifs: add copy action Also actions fill width * sidebar/notifs: better actions Fade at edges when scrollable * sidebar/notifs: fix urgency colours & icon * sidebar/notifs: remove unnecessary clipping * sidebar/notifs: fix artifacts with actions --- services/Notifs.qml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'services/Notifs.qml') diff --git a/services/Notifs.qml b/services/Notifs.qml index b651442..c5f0700 100644 --- a/services/Notifs.qml +++ b/services/Notifs.qml @@ -30,7 +30,10 @@ Singleton { appName: n.appName, image: n.image, expireTimeout: n.expireTimeout, - urgency: n.urgency + urgency: n.urgency, + resident: n.resident, + hasActionIcons: n.hasActionIcons, + actions: n.actions })))); } @@ -73,6 +76,12 @@ Singleton { root.list.push(notifComp.createObject(root, notif)); root.loaded = true; } + onLoadFailed: err => { + if (err === FileViewError.FileNotFound) { + root.loaded = true; + setText("[]"); + } + } } CustomShortcut { @@ -138,7 +147,13 @@ Singleton { property string image: notification?.image ?? "" property real expireTimeout: notification?.expireTimeout ?? Config.notifs.defaultExpireTimeout property int urgency: notification?.urgency ?? NotificationUrgency.Normal - readonly property list actions: notification?.actions ?? [] + property bool resident: notification?.resident ?? false + property bool hasActionIcons: notification?.hasActionIcons ?? false + property list actions: notification?.actions.map(a => ({ + identifier: a.identifier, + text: a.text, + invoke: () => a.invoke() + })) ?? [] readonly property Timer timer: Timer { running: true -- cgit v1.2.3-freya