lock: fix media position

This commit is contained in:
2 * r + 2 * t 2025-06-25 17:09:31 +10:00
parent 7223622933
commit 173738c0be
2 changed files with 41 additions and 38 deletions

View file

@ -6,8 +6,6 @@ import QtQuick.Layouts
ColumnLayout { ColumnLayout {
id: root id: root
required property bool locked
spacing: 0 spacing: 0
RowLayout { RowLayout {

View file

@ -90,8 +90,6 @@ WlSessionLockSurface {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.top anchors.bottom: parent.top
anchors.bottomMargin: -backgrounds.clockBottom anchors.bottomMargin: -backgrounds.clockBottom
locked: root.locked
} }
Input { Input {
@ -112,48 +110,55 @@ WlSessionLockSurface {
} }
Loader { Loader {
id: media
active: root.screen.width > Config.lock.sizes.smallScreenWidth active: root.screen.width > Config.lock.sizes.smallScreenWidth
asynchronous: true asynchronous: true
sourceComponent: MediaPlaying { state: root.screen.width > Config.lock.sizes.largeScreenWidth ? "tl" : "br"
id: media states: [
State {
name: "tl"
isLarge: root.screen.width > Config.lock.sizes.largeScreenWidth AnchorChanges {
target: media
state: isLarge ? "tl" : "br" anchors.bottom: media.parent.top
states: [ anchors.right: media.parent.left
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.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
}
}
]
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 { component Anim: NumberAnimation {
duration: Appearance.anim.durations.large duration: Appearance.anim.durations.large
easing.type: Easing.BezierSpline easing.type: Easing.BezierSpline