summaryrefslogtreecommitdiff
path: root/modules/sidebar/Notif.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-21 14:24:35 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-21 14:24:35 +1000
commit9523fdf0ebc7f98e0639ac5df2c5d2a25a8abaef (patch)
treea510eab2f41abf791957ba23dd1bdbcde08fbaa9 /modules/sidebar/Notif.qml
parent[CI] chore: update flake (diff)
downloadcaelestia-shell-9523fdf0ebc7f98e0639ac5df2c5d2a25a8abaef.tar.gz
caelestia-shell-9523fdf0ebc7f98e0639ac5df2c5d2a25a8abaef.tar.bz2
caelestia-shell-9523fdf0ebc7f98e0639ac5df2c5d2a25a8abaef.zip
sidebar/notifs: add link support
Diffstat (limited to 'modules/sidebar/Notif.qml')
-rw-r--r--modules/sidebar/Notif.qml12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/sidebar/Notif.qml b/modules/sidebar/Notif.qml
index e513583..5a31764 100644
--- a/modules/sidebar/Notif.qml
+++ b/modules/sidebar/Notif.qml
@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
import qs.components
import qs.services
import qs.config
+import Quickshell
import QtQuick
import QtQuick.Layouts
@@ -12,7 +13,9 @@ StyledRect {
required property Notifs.Notif modelData
required property Props props
required property bool expanded
+ required property var visibilities
+ readonly property StyledText body: expandedContent.item?.body ?? null
readonly property real nonAnimHeight: expanded ? summary.implicitHeight + expandedContent.implicitHeight + expandedContent.anchors.topMargin + Appearance.padding.normal * 2 : summaryHeightMetrics.height
implicitHeight: nonAnimHeight
@@ -116,14 +119,23 @@ StyledRect {
anchors.topMargin: Appearance.spacing.small / 2
sourceComponent: ColumnLayout {
+ readonly property alias body: body
+
spacing: Appearance.spacing.smaller
StyledText {
+ id: body
+
Layout.fillWidth: true
textFormat: Text.MarkdownText
text: root.modelData.body.replace(/(.)\n(?!\n)/g, "$1\n\n") || qsTr("No body here! :/")
color: root.modelData.urgency === "critical" ? Colours.palette.m3secondary : Colours.palette.m3outline
wrapMode: Text.WordWrap
+
+ onLinkActivated: link => {
+ Quickshell.execDetached(["app2unit", "-O", "--", link]);
+ root.visibilities.sidebar = false;
+ }
}
NotifActionList {