summaryrefslogtreecommitdiff
path: root/modules/session/Background.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-11 23:55:05 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-11 23:55:05 +1000
commit60858f6f02fb7dc04e727db89090e7b83399803a (patch)
tree0a6300271786a38a468ba4bb6df0c392eed82043 /modules/session/Background.qml
parentosd: fix show on hover (diff)
downloadcaelestia-shell-60858f6f02fb7dc04e727db89090e7b83399803a.tar.gz
caelestia-shell-60858f6f02fb7dc04e727db89090e7b83399803a.tar.bz2
caelestia-shell-60858f6f02fb7dc04e727db89090e7b83399803a.zip
feat: session menu
Diffstat (limited to 'modules/session/Background.qml')
-rw-r--r--modules/session/Background.qml70
1 files changed, 70 insertions, 0 deletions
diff --git a/modules/session/Background.qml b/modules/session/Background.qml
new file mode 100644
index 0000000..4b4b92e
--- /dev/null
+++ b/modules/session/Background.qml
@@ -0,0 +1,70 @@
+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: wrapperWidth < rounding * 2
+ readonly property real roundingX: flatten ? wrapperWidth / 2 : rounding
+
+ preferredRendererType: Shape.CurveRenderer
+ opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
+
+ ShapePath {
+ strokeWidth: -1
+ fillColor: BorderConfig.colour
+
+ startX: root.wrapperWidth - 1
+
+ PathArc {
+ relativeX: -root.roundingX
+ relativeY: root.rounding
+ radiusX: Math.min(root.rounding, root.wrapperWidth)
+ radiusY: root.rounding
+ }
+ PathLine {
+ x: root.roundingX
+ relativeY: 0
+ }
+ PathArc {
+ relativeX: -root.roundingX
+ relativeY: root.rounding
+ radiusX: Math.min(root.rounding, root.wrapperWidth)
+ radiusY: root.rounding
+ direction: PathArc.Counterclockwise
+ }
+ PathLine {
+ y: root.wrapperHeight - root.rounding * 2
+ }
+ PathArc {
+ relativeX: root.roundingX
+ relativeY: root.rounding
+ radiusX: Math.min(root.rounding, root.wrapperWidth)
+ radiusY: root.rounding
+ direction: PathArc.Counterclockwise
+ }
+ PathLine {
+ x: (root.flatten ? root.roundingX : root.wrapperWidth - root.rounding) - 1
+ relativeY: 0
+ }
+ PathArc {
+ relativeX: root.roundingX
+ relativeY: root.rounding
+ radiusX: Math.min(root.rounding, root.wrapperWidth)
+ radiusY: root.rounding
+ }
+
+ Behavior on fillColor {
+ ColorAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
+ }
+}