summaryrefslogtreecommitdiff
path: root/modules/notifications/Background.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-08 20:58:18 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-08 20:58:18 +1000
commita1ed341639fd73ce916eecfce480b14cd8660999 (patch)
treeb8d12c8f03057246e17a360f69bd83a61465e9bd /modules/notifications/Background.qml
parentrefactor: split drawers (diff)
downloadcaelestia-shell-a1ed341639fd73ce916eecfce480b14cd8660999.tar.gz
caelestia-shell-a1ed341639fd73ce916eecfce480b14cd8660999.tar.bz2
caelestia-shell-a1ed341639fd73ce916eecfce480b14cd8660999.zip
feat: notification popup area
Diffstat (limited to 'modules/notifications/Background.qml')
-rw-r--r--modules/notifications/Background.qml61
1 files changed, 61 insertions, 0 deletions
diff --git a/modules/notifications/Background.qml b/modules/notifications/Background.qml
new file mode 100644
index 0000000..e3289af
--- /dev/null
+++ b/modules/notifications/Background.qml
@@ -0,0 +1,61 @@
+import "root:/services"
+import "root:/config"
+import QtQuick
+import QtQuick.Shapes
+
+Shape {
+ id: root
+
+ required property real wrapperWidth
+ required property real wrapperHeight
+ readonly property real rounding: BorderConfig.rounding
+ readonly property bool flatten: wrapperHeight < rounding * 2
+ readonly property real roundingY: flatten ? wrapperHeight / 2 : rounding
+
+ preferredRendererType: Shape.CurveRenderer
+ opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
+
+ ShapePath {
+ strokeWidth: -1
+ fillColor: BorderConfig.colour
+
+ startX: root.wrapperWidth
+
+ PathLine {}
+ PathArc {
+ relativeX: root.rounding
+ relativeY: root.roundingY
+ radiusX: root.rounding
+ radiusY: Math.min(root.rounding, root.wrapperHeight)
+ }
+ PathLine {
+ relativeX: 0
+ y: root.flatten ? root.roundingY : root.wrapperHeight - root.rounding
+ }
+ PathArc {
+ relativeX: root.rounding
+ relativeY: root.roundingY
+ radiusX: root.rounding
+ radiusY: Math.min(root.rounding, root.wrapperHeight)
+ direction: PathArc.Counterclockwise
+ }
+ PathLine {
+ x: root.wrapperWidth - root.rounding - 1
+ relativeY: 0
+ }
+ PathArc {
+ relativeX: root.rounding
+ relativeY: root.rounding
+ radiusX: root.rounding
+ radiusY: root.rounding
+ }
+
+ Behavior on fillColor {
+ ColorAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
+ }
+}