From 73682163cac8a00606683a45775cdbf9d84bc0b0 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 25 Jun 2025 16:25:18 +1000 Subject: lock: move media to bottom right if small screen --- modules/lock/LockSurface.qml | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'modules/lock/LockSurface.qml') diff --git a/modules/lock/LockSurface.qml b/modules/lock/LockSurface.qml index b846241..87f9cb0 100644 --- a/modules/lock/LockSurface.qml +++ b/modules/lock/LockSurface.qml @@ -71,6 +71,7 @@ WlSessionLockSurface { locked: root.locked weatherWidth: weather.implicitWidth + isLarge: root.screen.width > 1920 visible: false } @@ -108,10 +109,41 @@ WlSessionLockSurface { } MediaPlaying { - anchors.bottom: parent.top - anchors.right: parent.left - anchors.bottomMargin: -backgrounds.mediaBottom - anchors.rightMargin: -backgrounds.mediaRight + id: media + + isLarge: root.screen.width > 1920 + + state: isLarge ? "tl" : "br" + states: [ + State { + name: "tl" + + AnchorChanges { + target: media + anchors.bottom: media.parent.top + anchors.right: media.parent.left + } + + PropertyChanges { + media.anchors.bottomMargin: -backgrounds.mediaY + media.anchors.rightMargin: -backgrounds.mediaX + } + }, + State { + name: "br" + + AnchorChanges { + target: media + anchors.top: media.parent.bottom + anchors.left: media.parent.right + } + + PropertyChanges { + media.anchors.topMargin: -backgrounds.mediaY + media.anchors.leftMargin: -backgrounds.mediaX + } + } + ] } component Anim: NumberAnimation { -- cgit v1.2.3-freya