summaryrefslogtreecommitdiff
path: root/modules/notifications/Background.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-13 18:23:11 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-13 18:23:11 +1000
commit8ea4362ba1e955dfd60a553484a00356eff5e06a (patch)
tree33cb8537a51d350a9c180e98df01d5b2c3f4af63 /modules/notifications/Background.qml
parentosd: fix show on hover + show on audio/brightness change (diff)
downloadcaelestia-shell-8ea4362ba1e955dfd60a553484a00356eff5e06a.tar.gz
caelestia-shell-8ea4362ba1e955dfd60a553484a00356eff5e06a.tar.bz2
caelestia-shell-8ea4362ba1e955dfd60a553484a00356eff5e06a.zip
notifs: move to drawers
Diffstat (limited to 'modules/notifications/Background.qml')
-rw-r--r--modules/notifications/Background.qml93
1 files changed, 42 insertions, 51 deletions
diff --git a/modules/notifications/Background.qml b/modules/notifications/Background.qml
index a0ed11e..9e66697 100644
--- a/modules/notifications/Background.qml
+++ b/modules/notifications/Background.qml
@@ -3,63 +3,54 @@ import "root:/config"
import QtQuick
import QtQuick.Shapes
-Shape {
+ShapePath {
id: root
- required property real wrapperWidth
- required property real wrapperHeight
+ required property Wrapper wrapper
readonly property real rounding: BorderConfig.rounding
- readonly property bool flatten: wrapperHeight < rounding * 2
- readonly property real roundingY: flatten ? wrapperHeight / 2 : rounding
+ readonly property bool flatten: wrapper.height < rounding * 2
+ readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
- preferredRendererType: Shape.CurveRenderer
- opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
+ strokeWidth: -1
+ fillColor: BorderConfig.colour
- 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
- }
- PathLine {
- relativeX: 1
- relativeY: 0
- }
+ PathLine {
+ relativeX: -root.wrapper.width
+ relativeY: 0
+ }
+ PathArc {
+ relativeX: root.rounding
+ relativeY: root.roundingY
+ radiusX: root.rounding
+ radiusY: Math.min(root.rounding, root.wrapper.height)
+ }
+ PathLine {
+ relativeX: 0
+ relativeY: root.wrapper.height - root.roundingY * 2
+ }
+ PathArc {
+ relativeX: root.rounding
+ relativeY: root.roundingY
+ radiusX: root.rounding
+ radiusY: Math.min(root.rounding, root.wrapper.height)
+ direction: PathArc.Counterclockwise
+ }
+ PathLine {
+ relativeX: root.wrapper.height > 0 ? root.wrapper.width - root.rounding * 3 : root.wrapper.width
+ 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
- }
+ Behavior on fillColor {
+ ColorAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
}
}
}