summaryrefslogtreecommitdiff
path: root/modules/notifications
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-26 23:03:53 +0800
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-26 23:03:53 +0800
commit178b79fafa3d7d65aa3364066ee248e7f51f015e (patch)
treef4a9ff7001dcb0656bc7283507ebd0ba88c89ae3 /modules/notifications
parentnotifs: better height (diff)
downloadcaelestia-shell-178b79fafa3d7d65aa3364066ee248e7f51f015e.tar.gz
caelestia-shell-178b79fafa3d7d65aa3364066ee248e7f51f015e.tar.bz2
caelestia-shell-178b79fafa3d7d65aa3364066ee248e7f51f015e.zip
notifs: change rounding when full height
Diffstat (limited to 'modules/notifications')
-rw-r--r--modules/notifications/Background.qml18
1 files changed, 14 insertions, 4 deletions
diff --git a/modules/notifications/Background.qml b/modules/notifications/Background.qml
index 9e66697..ea9e3a1 100644
--- a/modules/notifications/Background.qml
+++ b/modules/notifications/Background.qml
@@ -1,5 +1,6 @@
import "root:/services"
import "root:/config"
+import Quickshell
import QtQuick
import QtQuick.Shapes
@@ -10,6 +11,7 @@ ShapePath {
readonly property real rounding: BorderConfig.rounding
readonly property bool flatten: wrapper.height < rounding * 2
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
+ property real fullHeightRounding: wrapper.height >= QsWindow.window?.height - BorderConfig.thickness * 2 ? -rounding : rounding
strokeWidth: -1
fillColor: BorderConfig.colour
@@ -29,14 +31,14 @@ ShapePath {
relativeY: root.wrapper.height - root.roundingY * 2
}
PathArc {
- relativeX: root.rounding
+ relativeX: root.fullHeightRounding
relativeY: root.roundingY
- radiusX: root.rounding
+ radiusX: Math.abs(root.fullHeightRounding)
radiusY: Math.min(root.rounding, root.wrapper.height)
- direction: PathArc.Counterclockwise
+ direction: root.fullHeightRounding < 0 ? PathArc.Clockwise : PathArc.Counterclockwise
}
PathLine {
- relativeX: root.wrapper.height > 0 ? root.wrapper.width - root.rounding * 3 : root.wrapper.width
+ relativeX: root.wrapper.height > 0 ? root.wrapper.width - root.rounding * 2 - root.fullHeightRounding : root.wrapper.width
relativeY: 0
}
PathArc {
@@ -53,4 +55,12 @@ ShapePath {
easing.bezierCurve: Appearance.anim.curves.standard
}
}
+
+ Behavior on fullHeightRounding {
+ NumberAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
}