@@ -10,6 +10,7 @@ import Quickshell.Widgets
1010import Quickshell.Services.Notifications
1111import QtQuick
1212import QtQuick.Layouts
13+ import QtQuick.Shapes
1314
1415StyledRect {
1516 id: root
@@ -23,7 +24,7 @@ StyledRect {
2324 color: root .modelData .urgency === NotificationUrgency .Critical ? Colours .palette .m3secondaryContainer : Colours .tPalette .m3surfaceContainer
2425 radius: Appearance .rounding .normal
2526 implicitWidth: Config .notifs .sizes .width
26- implicitHeight: inner .implicitHeight
27+ implicitHeight: inner .implicitHeight + progressBar . implicitHeight
2728
2829 x: Config .notifs .sizes .width
2930 Component .onCompleted : x = 0
@@ -312,12 +313,78 @@ StyledRect {
312313 font .pointSize : Appearance .font .size .small
313314 }
314315
316+ Loader {
317+ active: Config .notifs .timeoutCircle
318+ asynchronous: true
319+ anchors .centerIn : closeBtn
320+
321+ sourceComponent: Shape {
322+ id: progressCircle
323+ width: closeBtn .implicitWidth + Appearance .padding .small
324+ height: closeBtn .implicitHeight + Appearance .padding .small
325+ preferredRendererType: Shape .CurveRenderer
326+
327+ ShapePath {
328+ capStyle: ShapePath .FlatCap
329+ fillColor: " transparent"
330+ strokeWidth: Appearance .padding .small
331+ strokeColor: Colours .palette .m3tertiary
332+
333+ PathAngleArc {
334+ centerX: progressCircle .width / 2
335+ centerY: progressCircle .height / 2
336+ radiusX: progressCircle .width / 2 - Appearance .padding .small / 2
337+ radiusY: progressCircle .height / 2 - Appearance .padding .small / 2
338+
339+ startAngle: - 90
340+
341+ NumberAnimation on sweepAngle {
342+ from: 360
343+ to: 0
344+ duration: Config .notifs .defaultExpireTimeout
345+ running: root .modelData .timer .running
346+ }
347+ }
348+ }
349+ }
350+ }
351+
315352 Item {
316- id: expandBtn
353+ id: closeBtn
317354
318355 anchors .right : parent .right
319356 anchors .top : parent .top
320357
358+ implicitWidth: closeIcon .height
359+ implicitHeight: closeIcon .height
360+
361+ StateLayer {
362+ radius: Appearance .rounding .full
363+ color: Colours .palette .m3onSurface
364+
365+ function onClicked () {
366+ root .modelData .notification .dismiss ();
367+ }
368+ }
369+
370+ MaterialIcon {
371+ id: closeIcon
372+
373+ anchors .centerIn : parent
374+
375+ animate: true
376+ text: " close"
377+ font .pointSize : Appearance .font .size .normal
378+ }
379+ }
380+
381+ Item {
382+ id: expandBtn
383+
384+ anchors .right : closeBtn .left
385+ anchors .top : parent .top
386+ anchors .rightMargin : Appearance .spacing .small
387+
321388 implicitWidth: expandIcon .height
322389 implicitHeight: expandIcon .height
323390
@@ -438,6 +505,30 @@ StyledRect {
438505 }
439506 }
440507
508+ Loader {
509+ id: progressBar
510+ active: Config .notifs .timeoutBar
511+ asynchronous: true
512+
513+ anchors .right : parent .right
514+ anchors .bottom : parent .bottom
515+
516+ sourceComponent: StyledRect {
517+ anchors .topMargin : Appearance .padding .small
518+
519+ implicitHeight: Appearance .padding .small
520+
521+ color: Colours .palette .m3tertiary
522+
523+ NumberAnimation on implicitWidth {
524+ from: root .width
525+ to: 0
526+ duration: Config .notifs .defaultExpireTimeout
527+ running: root .modelData .timer .running
528+ }
529+ }
530+ }
531+
441532 component Action: StyledRect {
442533 id: action
443534
0 commit comments