lock: better scaling + fix null error

This commit is contained in:
2 * r + 2 * t 2025-08-12 12:21:34 +10:00
parent 38506e6029
commit 68bb5dd7f9
3 changed files with 8 additions and 7 deletions

View file

@ -13,8 +13,9 @@ ColumnLayout {
required property var lock required property var lock
readonly property list<string> timeComponents: Time.format(Config.services.useTwelveHourClock ? "hh:mm:A" : "hh:mm").split(":") readonly property list<string> timeComponents: Time.format(Config.services.useTwelveHourClock ? "hh:mm:A" : "hh:mm").split(":")
readonly property int centerWidth: Config.lock.sizes.centerWidth * Math.min(1, lock.screen.height / 1440)
Layout.preferredWidth: Config.lock.sizes.centerWidth Layout.preferredWidth: centerWidth
Layout.fillHeight: true Layout.fillHeight: true
spacing: Appearance.spacing.large * 2 spacing: Appearance.spacing.large * 2
@ -79,8 +80,8 @@ ColumnLayout {
Layout.topMargin: Appearance.spacing.large * 2 Layout.topMargin: Appearance.spacing.large * 2
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
implicitWidth: Config.lock.sizes.centerWidth / 2 implicitWidth: root.centerWidth / 2
implicitHeight: Config.lock.sizes.centerWidth / 2 implicitHeight: root.centerWidth / 2
color: Colours.tPalette.m3surfaceContainer color: Colours.tPalette.m3surfaceContainer
radius: Appearance.rounding.full radius: Appearance.rounding.full
@ -91,7 +92,7 @@ ColumnLayout {
text: "person" text: "person"
fill: 1 fill: 1
grade: 200 grade: 200
font.pointSize: Math.floor(Config.lock.sizes.centerWidth / 4) font.pointSize: Math.floor(root.centerWidth / 4) || 1
} }
CachingImage { CachingImage {
@ -105,7 +106,7 @@ ColumnLayout {
StyledRect { StyledRect {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
implicitWidth: Config.lock.sizes.centerWidth * 0.8 implicitWidth: root.centerWidth * 0.8
implicitHeight: input.implicitHeight + Appearance.padding.small * 2 implicitHeight: input.implicitHeight + Appearance.padding.small * 2
color: Colours.tPalette.m3surfaceContainer color: Colours.tPalette.m3surfaceContainer

View file

@ -109,7 +109,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
asynchronous: true asynchronous: true
active: root.height > 250 active: root.height > 220
visible: active visible: active
sourceComponent: RowLayout { sourceComponent: RowLayout {

View file

@ -17,7 +17,7 @@ Item {
Image { Image {
anchors.fill: parent anchors.fill: parent
source: Players.active?.trackArtUrl ?? null source: Players.active?.trackArtUrl ?? ""
asynchronous: true asynchronous: true
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop