notifs: use app2unit for links

also make links only reactive when expanded
This commit is contained in:
Soramane 2025-07-16 17:38:00 +10:00
parent 01f724800f
commit 38e9e24390

View file

@ -37,7 +37,7 @@ StyledRect {
anchors.fill: parent
hoverEnabled: true
cursorShape: body.hoveredLink ? Qt.PointingHandCursor : pressed ? Qt.ClosedHandCursor : undefined
cursorShape: root.expanded && body.hoveredLink ? Qt.PointingHandCursor : pressed ? Qt.ClosedHandCursor : undefined
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
preventStealing: true
@ -387,7 +387,10 @@ StyledRect {
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
onLinkActivated: link => {
Qt.openUrlExternally(link);
if (!root.expanded)
return;
Quickshell.execDetached(["app2unit", "-O", "--", link]);
root.modelData.notification.dismiss(); // TODO: change back to popup when notif dock impled
}