@@ -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 : {
@@ -311,12 +312,78 @@ StyledRect {
311312 font .pointSize : Appearance .font .size .small
312313 }
313314
315+ Loader {
316+ active: Config .notifs .timeoutCircle
317+ asynchronous: true
318+ anchors .centerIn : closeBtn
319+
320+ sourceComponent: Shape {
321+ id: progressCircle
322+ width: closeBtn .implicitWidth + Appearance .padding .small
323+ height: closeBtn .implicitHeight + Appearance .padding .small
324+ preferredRendererType: Shape .CurveRenderer
325+
326+ ShapePath {
327+ capStyle: ShapePath .FlatCap
328+ fillColor: " transparent"
329+ strokeWidth: Appearance .padding .small
330+ strokeColor: Colours .palette .m3tertiary
331+
332+ PathAngleArc {
333+ centerX: progressCircle .width / 2
334+ centerY: progressCircle .height / 2
335+ radiusX: progressCircle .width / 2 - Appearance .padding .small / 2
336+ radiusY: progressCircle .height / 2 - Appearance .padding .small / 2
337+
338+ startAngle: - 90
339+
340+ NumberAnimation on sweepAngle {
341+ from: 360
342+ to: 0
343+ duration: Config .notifs .defaultExpireTimeout
344+ running: root .modelData .timer .running
345+ }
346+ }
347+ }
348+ }
349+ }
350+
314351 Item {
315- id: expandBtn
352+ id: closeBtn
316353
317354 anchors .right : parent .right
318355 anchors .top : parent .top
319356
357+ implicitWidth: closeIcon .height
358+ implicitHeight: closeIcon .height
359+
360+ StateLayer {
361+ radius: Appearance .rounding .full
362+ color: Colours .palette .m3onSurface
363+
364+ function onClicked () {
365+ root .modelData .notification .dismiss ();
366+ }
367+ }
368+
369+ MaterialIcon {
370+ id: closeIcon
371+
372+ anchors .centerIn : parent
373+
374+ animate: true
375+ text: " close"
376+ font .pointSize : Appearance .font .size .normal
377+ }
378+ }
379+
380+ Item {
381+ id: expandBtn
382+
383+ anchors .right : closeBtn .left
384+ anchors .top : parent .top
385+ anchors .rightMargin : Appearance .spacing .small
386+
320387 implicitWidth: expandIcon .height
321388 implicitHeight: expandIcon .height
322389
@@ -437,6 +504,30 @@ StyledRect {
437504 }
438505 }
439506
507+ Loader {
508+ id: progressBar
509+ active: Config .notifs .timeoutBar
510+ asynchronous: true
511+
512+ anchors .right : parent .right
513+ anchors .bottom : parent .bottom
514+
515+ sourceComponent: StyledRect {
516+ anchors .topMargin : Appearance .padding .small
517+
518+ implicitHeight: Appearance .padding .small
519+
520+ color: Colours .palette .m3tertiary
521+
522+ NumberAnimation on implicitWidth {
523+ from: root .width
524+ to: 0
525+ duration: Config .notifs .defaultExpireTimeout
526+ running: root .modelData .timer .running
527+ }
528+ }
529+ }
530+
440531 component Action: StyledRect {
441532 id: action
442533
0 commit comments