From 92700bbd84511c0d2963d29c5346118322e67562 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 23 Jun 2025 19:33:55 +1000 Subject: lock: add media --- modules/lock/Backgrounds.qml | 66 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'modules/lock/Backgrounds.qml') 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 { -- cgit v1.2.3-freya