summaryrefslogtreecommitdiff
path: root/modules/lock/Backgrounds.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-25 16:25:18 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-25 16:25:18 +1000
commit73682163cac8a00606683a45775cdbf9d84bc0b0 (patch)
treefa11834c5e1861ad401cb3ffaa79b02a0afaf0e0 /modules/lock/Backgrounds.qml
parentlock: fix exit anim for multimon (diff)
downloadcaelestia-shell-73682163cac8a00606683a45775cdbf9d84bc0b0.tar.gz
caelestia-shell-73682163cac8a00606683a45775cdbf9d84bc0b0.tar.bz2
caelestia-shell-73682163cac8a00606683a45775cdbf9d84bc0b0.zip
lock: move media to bottom right if small screen
Diffstat (limited to 'modules/lock/Backgrounds.qml')
-rw-r--r--modules/lock/Backgrounds.qml27
1 files changed, 15 insertions, 12 deletions
diff --git a/modules/lock/Backgrounds.qml b/modules/lock/Backgrounds.qml
index d165ef3..85ebe6e 100644
--- a/modules/lock/Backgrounds.qml
+++ b/modules/lock/Backgrounds.qml
@@ -10,13 +10,15 @@ Item {
required property bool locked
required property real weatherWidth
+ required property bool isLarge
readonly property real clockBottom: innerMask.anchors.margins + clockPath.height
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
+
+ readonly property real mediaX: innerMask.anchors.margins + mediaPath.width
+ readonly property real mediaY: innerMask.anchors.margins + mediaPath.height
anchors.fill: parent
@@ -277,37 +279,38 @@ Item {
strokeWidth: -1
fillColor: Config.border.colour
- startY: height + roundingY
+ startX: root.isLarge ? 0 : Math.ceil(innerMask.width)
+ startY: root.isLarge ? height + roundingY : Math.ceil(innerMask.height) - height - roundingY
PathArc {
- relativeX: mediaPath.roundingX
- relativeY: -mediaPath.roundingY
+ relativeX: mediaPath.roundingX * (root.isLarge ? 1 : -1)
+ relativeY: mediaPath.roundingY * (root.isLarge ? -1 : 1)
radiusX: Math.min(mediaPath.rounding, mediaPath.width)
radiusY: Math.min(mediaPath.rounding, mediaPath.height)
}
PathLine {
- relativeX: mediaPath.width - mediaPath.roundingX * 2
+ relativeX: (mediaPath.width - mediaPath.roundingX * 2) * (root.isLarge ? 1 : -1)
relativeY: 0
}
PathArc {
- relativeX: mediaPath.roundingX
- relativeY: -mediaPath.roundingY
+ relativeX: mediaPath.roundingX * (root.isLarge ? 1 : -1)
+ relativeY: mediaPath.roundingY * (root.isLarge ? -1 : 1)
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)
+ relativeY: (mediaPath.height - mediaPath.roundingY * 2) * (root.isLarge ? -1 : 1)
}
PathArc {
- relativeX: mediaPath.roundingX
- relativeY: -mediaPath.roundingY
+ relativeX: mediaPath.roundingX * (root.isLarge ? 1 : -1)
+ relativeY: mediaPath.roundingY * (root.isLarge ? -1 : 1)
radiusX: Math.min(mediaPath.rounding, mediaPath.width)
radiusY: Math.min(mediaPath.rounding, mediaPath.height)
}
PathLine {
- relativeX: -mediaPath.width - mediaPath.roundingX
+ relativeX: (-mediaPath.width - mediaPath.roundingX) * (root.isLarge ? 1 : -1)
relativeY: 0
}