experimental notification focus

This commit is contained in:
Zoty 2026-06-25 08:26:57 -03:00
parent 38db696ee8
commit 4b0974e74e
Signed by: Zoty
SSH key fingerprint: SHA256:WsGEGivgl37t3Mth6uugXMOgMCTR7QolIepNbC+j/tA
5 changed files with 204 additions and 44 deletions

View file

@ -9,6 +9,8 @@ Item {
required property string summary
required property string body
required property string appIcon
required property string image
required property string desktopEntry
required property int urgency
required property var timestamp
@ -52,10 +54,15 @@ Item {
id: iconImg
anchors.fill: parent
anchors.margins: 5
source: root.appIcon
fillMode: Image.PreserveAspectFit
visible: status === Image.Ready
smooth: true
source: {
if (root.image) return root.image
if (!root.appIcon) return ""
if (root.appIcon.startsWith("/")) return root.appIcon
return Quickshell.iconPath(root.appIcon, true) || ""
}
fillMode: Image.PreserveAspectFit
visible: status === Image.Ready && source !== ""
smooth: true
}
Text {
@ -98,6 +105,7 @@ Item {
Text {
visible: root.body.length > 0
text: root.body
textFormat: Text.StyledText
color: Theme.fg2
font.pixelSize: Theme.fontSizeSmall
font.family: Theme.font
@ -158,7 +166,7 @@ Item {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
NotificationsState.invokeDefault(root.nid)
NotificationsState.invokeDefault(root.nid, root.desktopEntry || root.appName)
root.dismissed()
}
}