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

@ -60,10 +60,17 @@ PanelWindow {
id: tIcon
anchors.fill: parent
anchors.margins: 5
source: model.appIcon
fillMode: Image.PreserveAspectFit
visible: status === Image.Ready
smooth: true
// Priority: notification image (avatar/screenshot) > app icon.
// appIcon can be a path or a theme name; iconPath() resolves theme names.
source: {
if (model.image) return model.image
if (!model.appIcon) return ""
if (model.appIcon.startsWith("/")) return model.appIcon
return Quickshell.iconPath(model.appIcon, true) || ""
}
fillMode: Image.PreserveAspectFit
visible: status === Image.Ready && source !== ""
smooth: true
}
Text {
@ -106,6 +113,7 @@ PanelWindow {
Text {
visible: model.body.length > 0
text: model.body
textFormat: Text.StyledText
color: Theme.fg2
font.pixelSize: Theme.fontSizeSmall
font.family: Theme.font
@ -161,7 +169,7 @@ PanelWindow {
anchors.rightMargin: 34
cursorShape: Qt.PointingHandCursor
onClicked: {
NotificationsState.invokeDefault(model.tid)
NotificationsState.invokeDefault(model.tid, model.desktopEntry || model.appName)
NotificationsState.dismissToast(model.tid)
}
}