LockScreen: fixed multi-monitor setup!

This commit is contained in:
LemmyCook 2025-08-21 23:15:41 -04:00
parent 8f829da5cb
commit d135139100
2 changed files with 261 additions and 262 deletions

View file

@ -43,14 +43,6 @@ Loader {
// Tie session lock to loader visibility // Tie session lock to loader visibility
locked: lockScreen.active locked: lockScreen.active
// Lockscreen is a different beast, needs a capital 'S' in 'Screen' to access the current screen
// Also we use a different scaling algorithm based on the resolution, as the design is full screen
readonly property real scaling: {
var tt = ScalingService.dynamicScale(Screen)
console.log(tt)
return tt
}
property string errorMessage: "" property string errorMessage: ""
property bool authenticating: false property bool authenticating: false
property string password: "" property string password: ""
@ -127,6 +119,11 @@ Loader {
WlSessionLockSurface { WlSessionLockSurface {
// Battery indicator component // Battery indicator component
// WlSessionLockSurface provides a screen variable for the current screen.
// Also we use a different scaling algorithm based on the resolution, as the design is full screen.
readonly property real scaling: ScalingService.dynamicScale(screen)
Item { Item {
id: batteryIndicator id: batteryIndicator
@ -500,11 +497,6 @@ Loader {
height: 280 * scaling height: 280 * scaling
anchors.centerIn: parent anchors.centerIn: parent
ColumnLayout {
anchors.centerIn: parent
spacing: 20 * scaling
width: parent.width
// Futuristic Terminal-Style Input // Futuristic Terminal-Style Input
Item { Item {
width: parent.width width: parent.width
@ -527,7 +519,7 @@ Loader {
width: parent.width width: parent.width
height: 1 height: 1
color: Color.applyOpacity(Color.mPrimary, "1A") color: Color.applyOpacity(Color.mPrimary, "1A")
y: index * 10 y: index * 10 * scaling
opacity: Style.opacityMedium opacity: Style.opacityMedium
SequentialAnimation on opacity { SequentialAnimation on opacity {
@ -554,7 +546,10 @@ Loader {
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
anchors.margins: Style.marginM * scaling anchors.topMargin: Style.marginM * scaling
anchors.bottomMargin: Style.marginM * scaling
anchors.leftMargin: Style.marginL * scaling
anchors.rightMargin: Style.marginL * scaling
spacing: Style.marginM * scaling spacing: Style.marginM * scaling
NText { NText {
@ -594,8 +589,8 @@ Loader {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: Style.marginL * scaling
anchors.topMargin: 70 * scaling anchors.topMargin: 70 * scaling
anchors.margins: Style.marginM * scaling
spacing: Style.marginM * scaling spacing: Style.marginM * scaling
// Welcome back typing effect // Welcome back typing effect
@ -760,6 +755,9 @@ Loader {
} }
// Execute button // Execute button
Row {
Layout.alignment: Qt.AlignRight
Layout.bottomMargin: -10 * scaling
Rectangle { Rectangle {
width: 120 * scaling width: 120 * scaling
height: 40 * scaling height: 40 * scaling
@ -768,8 +766,6 @@ Loader {
border.color: Color.mPrimary border.color: Color.mPrimary
border.width: Math.max(1, Style.borderS * scaling) border.width: Math.max(1, Style.borderS * scaling)
enabled: !lock.authenticating enabled: !lock.authenticating
Layout.alignment: Qt.AlignRight
Layout.bottomMargin: -12 * scaling
NText { NText {
anchors.centerIn: parent anchors.centerIn: parent
@ -822,6 +818,7 @@ Loader {
} }
} }
} }
}
// Terminal glow effect // Terminal glow effect
Rectangle { Rectangle {
@ -850,7 +847,6 @@ Loader {
} }
} }
} }
}
// Enhanced power buttons with hover effects // Enhanced power buttons with hover effects
Row { Row {

View file

@ -43,8 +43,11 @@ Singleton {
readonly property int designScreenHeight: 1440 readonly property int designScreenHeight: 1440
function dynamicScale(aScreen) { function dynamicScale(aScreen) {
if (aScreen != null) {
var ratioW = aScreen.width / designScreenWidth var ratioW = aScreen.width / designScreenWidth
var ratioH = aScreen.height / designScreenHeight var ratioH = aScreen.height / designScreenHeight
return Math.min(ratioW, ratioH) return Math.min(ratioW, ratioH)
} }
return 1.0
}
} }