summaryrefslogtreecommitdiff
path: root/modules/lock/Backgrounds.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-23 19:33:55 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-23 19:33:55 +1000
commit92700bbd84511c0d2963d29c5346118322e67562 (patch)
treea99f1eec415e32724ab7ac2f5357ffbf0a5467dd /modules/lock/Backgrounds.qml
parentdrawers: give back focus when close (diff)
downloadcaelestia-shell-92700bbd84511c0d2963d29c5346118322e67562.tar.gz
caelestia-shell-92700bbd84511c0d2963d29c5346118322e67562.tar.bz2
caelestia-shell-92700bbd84511c0d2963d29c5346118322e67562.zip
lock: add media
Diffstat (limited to 'modules/lock/Backgrounds.qml')
-rw-r--r--modules/lock/Backgrounds.qml66
1 files changed, 66 insertions, 0 deletions
diff --git a/modules/lock/Backgrounds.qml b/modules/lock/Backgrounds.qml
index 3bcedd6..d165ef3 100644
--- a/modules/lock/Backgrounds.qml
+++ b/modules/lock/Backgrounds.qml
@@ -15,6 +15,8 @@ Item {
readonly property real inputTop: innerMask.anchors.margins + inputPath.height
readonly property real weatherTop: innerMask.anchors.margins + weatherPath.height
readonly property real weatherRight: innerMask.anchors.margins + weatherPath.width
+ readonly property real mediaBottom: innerMask.anchors.margins + mediaPath.height
+ readonly property real mediaRight: innerMask.anchors.margins + mediaPath.width
anchors.fill: parent
@@ -261,6 +263,70 @@ Item {
}
}
}
+
+ ShapePath {
+ id: mediaPath
+
+ property int width: root.locked ? Config.lock.sizes.mediaWidth - Config.lock.sizes.border / 4 : 0
+ property real height: root.locked ? Config.lock.sizes.mediaHeight : 0
+
+ readonly property real rounding: Appearance.rounding.large * 2
+ readonly property real roundingX: width < rounding * 2 ? width / 2 : rounding
+ readonly property real roundingY: height < rounding * 2 ? height / 2 : rounding
+
+ strokeWidth: -1
+ fillColor: Config.border.colour
+
+ startY: height + roundingY
+
+ PathArc {
+ relativeX: mediaPath.roundingX
+ relativeY: -mediaPath.roundingY
+ radiusX: Math.min(mediaPath.rounding, mediaPath.width)
+ radiusY: Math.min(mediaPath.rounding, mediaPath.height)
+ }
+ PathLine {
+ relativeX: mediaPath.width - mediaPath.roundingX * 2
+ relativeY: 0
+ }
+ PathArc {
+ relativeX: mediaPath.roundingX
+ relativeY: -mediaPath.roundingY
+ radiusX: Math.min(mediaPath.rounding, mediaPath.width)
+ radiusY: Math.min(mediaPath.rounding, mediaPath.height)
+ direction: PathArc.Counterclockwise
+ }
+ PathLine {
+ relativeX: 0
+ relativeY: -(mediaPath.height - mediaPath.roundingY * 2)
+ }
+ PathArc {
+ relativeX: mediaPath.roundingX
+ relativeY: -mediaPath.roundingY
+ radiusX: Math.min(mediaPath.rounding, mediaPath.width)
+ radiusY: Math.min(mediaPath.rounding, mediaPath.height)
+ }
+ PathLine {
+ relativeX: -mediaPath.width - mediaPath.roundingX
+ relativeY: 0
+ }
+
+ Behavior on width {
+ Anim {}
+ }
+
+ Behavior on height {
+ Anim {}
+ }
+
+ Behavior on fillColor {
+ ColorAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
+ }
}
component Anim: NumberAnimation {