notifs: support int:value hint (#1254)

* add .vscode/settings.json to gitignore

* added support for the Int:value hint

* fix

* more fix

* f

* comment

---------

Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
This commit is contained in:
cordlessblues 2026-03-15 02:27:46 -05:00 committed by GitHub
parent dd2d7dceab
commit 533b6590cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 43 additions and 0 deletions

View file

@ -10,6 +10,7 @@ import Quickshell.Widgets
import Quickshell.Services.Notifications import Quickshell.Services.Notifications
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Shapes
StyledRect { StyledRect {
id: root id: root
@ -183,6 +184,42 @@ StyledRect {
} }
} }
Shape {
id: progressIndicator
anchors.centerIn: appIcon
width: appIcon.implicitWidth + progressShape.strokeWidth * 2
height: appIcon.implicitHeight + progressShape.strokeWidth * 2
preferredRendererType: Shape.CurveRenderer
ShapePath {
id: progressShape
capStyle: ShapePath.RoundCap
fillColor: "transparent"
strokeWidth: 2
strokeColor: Colours.palette.m3primary
PathAngleArc {
id: progressArc
radiusX: progressIndicator.width / 2 - Appearance.padding.small / 2
centerX: progressIndicator.width / 2
radiusY: progressIndicator.height / 2 - Appearance.padding.small / 2
centerY: progressIndicator.height / 2
startAngle: -90
sweepAngle: ((root.modelData.hints.value ?? 0) / 100) * 360
Behavior on sweepAngle {
Anim {
easing.bezierCurve: Appearance.anim.curves.emphasizedDecel
}
}
}
}
}
StyledText { StyledText {
id: appName id: appName

View file

@ -186,6 +186,7 @@ Singleton {
property string appIcon property string appIcon
property string appName property string appName
property string image property string image
property var hints // Hints are not persisted across restarts
property real expireTimeout: Config.notifs.defaultExpireTimeout property real expireTimeout: Config.notifs.defaultExpireTimeout
property int urgency: NotificationUrgency.Normal property int urgency: NotificationUrgency.Normal
property bool resident property bool resident
@ -301,6 +302,10 @@ Singleton {
invoke: () => a.invoke() invoke: () => a.invoke()
})); }));
} }
function onHintsChanged(): void {
notif.hints = notif.notification.hints;
}
} }
function lock(item: Item): void { function lock(item: Item): void {
@ -335,6 +340,7 @@ Singleton {
if (notification?.image) if (notification?.image)
dummyImageLoader.active = true; dummyImageLoader.active = true;
expireTimeout = notification.expireTimeout; expireTimeout = notification.expireTimeout;
hints = notification.hints;
urgency = notification.urgency; urgency = notification.urgency;
resident = notification.resident; resident = notification.resident;
hasActionIcons = notification.hasActionIcons; hasActionIcons = notification.hasActionIcons;