From 173738c0bec5d3d5d519e4988f32ac6e7f1121b8 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 25 Jun 2025 17:09:31 +1000 Subject: lock: fix media position --- modules/lock/Clock.qml | 2 -- modules/lock/LockSurface.qml | 75 +++++++++++++++++++++++--------------------- 2 files changed, 40 insertions(+), 37 deletions(-) (limited to 'modules') diff --git a/modules/lock/Clock.qml b/modules/lock/Clock.qml index 62209e7..9d0ae3f 100644 --- a/modules/lock/Clock.qml +++ b/modules/lock/Clock.qml @@ -6,8 +6,6 @@ import QtQuick.Layouts ColumnLayout { id: root - required property bool locked - spacing: 0 RowLayout { diff --git a/modules/lock/LockSurface.qml b/modules/lock/LockSurface.qml index 084c275..6c2ffa7 100644 --- a/modules/lock/LockSurface.qml +++ b/modules/lock/LockSurface.qml @@ -90,8 +90,6 @@ WlSessionLockSurface { anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.top anchors.bottomMargin: -backgrounds.clockBottom - - locked: root.locked } Input { @@ -112,48 +110,55 @@ WlSessionLockSurface { } Loader { + id: media + active: root.screen.width > Config.lock.sizes.smallScreenWidth asynchronous: true - sourceComponent: MediaPlaying { - id: media + state: root.screen.width > Config.lock.sizes.largeScreenWidth ? "tl" : "br" + states: [ + State { + name: "tl" - isLarge: root.screen.width > Config.lock.sizes.largeScreenWidth + 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 + } - 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 - } + PropertyChanges { + media.anchors.topMargin: -backgrounds.mediaY + media.anchors.leftMargin: -backgrounds.mediaX } - ] + } + ] + + sourceComponent: MediaPlaying { + isLarge: root.screen.width > Config.lock.sizes.largeScreenWidth } } + Loader { + active: root.screen.width > Config.lock.sizes.largeScreenWidth + asynchronous: true + + sourceComponent: Buttons {} + } + component Anim: NumberAnimation { duration: Appearance.anim.durations.large easing.type: Easing.BezierSpline -- cgit v1.2.3-freya