support multiple monitors for greeter

This commit is contained in:
2026-03-25 13:42:58 +01:00
parent 0fcbc4b8b1
commit be71172a37
2 changed files with 118 additions and 106 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ Singleton {
}
FileView {
path: `${Paths.state}/scheme.json`
path: "/etc/zshell-greeter/scheme.json"
watchChanges: true
onFileChanged: reload()
+117 -105
View File
@@ -8,136 +8,148 @@ import qs.Config
import qs.Helpers
import qs.Components
CustomWindow {
Scope {
id: root
required property var greeter
aboveWindows: true
focusable: true
Variants {
model: Quickshell.screens
anchors {
bottom: true
left: true
right: true
top: true
}
CustomWindow {
id: win
ParallelAnimation {
id: initAnim
required property ShellScreen modelData
running: true
aboveWindows: true
focusable: true
name: "Greeter"
screen: modelData
SequentialAnimation {
ParallelAnimation {
Anim {
duration: Appearance.anim.durations.expressiveFastSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveFastSpatial
property: "scale"
target: lockContent
to: 1
}
anchors {
bottom: true
left: true
right: true
top: true
}
ParallelAnimation {
Anim {
property: "opacity"
target: lockIcon
to: 0
}
id: initAnim
Anim {
property: "opacity"
target: content
to: 1
}
running: true
Anim {
duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
property: "scale"
target: content
to: 1
}
SequentialAnimation {
ParallelAnimation {
Anim {
duration: Appearance.anim.durations.expressiveFastSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveFastSpatial
property: "scale"
target: lockContent
to: 1
}
}
Anim {
property: "radius"
target: lockBg
to: Appearance.rounding.large * 1.5
}
ParallelAnimation {
Anim {
property: "opacity"
target: lockIcon
to: 0
}
Anim {
duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
property: "implicitWidth"
target: lockContent
to: (root.screen?.height ?? 0) * Config.lock.sizes.heightMult * Config.lock.sizes.ratio
}
Anim {
property: "opacity"
target: content
to: 1
}
Anim {
duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
property: "implicitHeight"
target: lockContent
to: (root.screen?.height ?? 0) * Config.lock.sizes.heightMult
Anim {
duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
property: "scale"
target: content
to: 1
}
Anim {
property: "radius"
target: lockBg
to: Appearance.rounding.large * 1.5
}
Anim {
duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
property: "implicitWidth"
target: lockContent
to: (win.screen?.height ?? 0) * Config.lock.sizes.heightMult * Config.lock.sizes.ratio
}
Anim {
duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
property: "implicitHeight"
target: lockContent
to: (win.screen?.height ?? 0) * Config.lock.sizes.heightMult
}
}
}
}
}
}
Image {
id: background
Image {
id: background
anchors.fill: parent
source: WallpaperPath.lockscreenBg
}
Item {
id: lockContent
readonly property int radius: size / 4 * Appearance.rounding.scale
readonly property int size: lockIcon.implicitHeight + Appearance.padding.large * 4
anchors.centerIn: parent
implicitHeight: size
implicitWidth: size
scale: 0
CustomRect {
id: lockBg
anchors.fill: parent
color: DynamicColors.palette.m3surface
layer.enabled: true
opacity: DynamicColors.transparency.enabled ? DynamicColors.transparency.base : 1
radius: lockContent.radius
layer.effect: MultiEffect {
blurMax: 15
shadowColor: Qt.alpha(DynamicColors.palette.m3shadow, 0.7)
shadowEnabled: true
anchors.fill: parent
source: WallpaperPath.lockscreenBg
}
}
MaterialIcon {
id: lockIcon
Item {
id: lockContent
anchors.centerIn: parent
font.bold: true
font.pointSize: Appearance.font.size.extraLarge * 4
text: "lock"
}
readonly property int radius: size / 4 * Appearance.rounding.scale
readonly property int size: lockIcon.implicitHeight + Appearance.padding.large * 4
Content {
id: content
anchors.centerIn: parent
implicitHeight: size
implicitWidth: size
scale: 0
anchors.centerIn: parent
greeter: root.greeter
height: (root.screen?.height ?? 0) * Config.lock.sizes.heightMult - Appearance.padding.large * 2
opacity: 0
scale: 0
screenHeight: root.screen?.height ?? 1440
width: (root.screen?.height ?? 0) * Config.lock.sizes.heightMult * Config.lock.sizes.ratio - Appearance.padding.large * 2
CustomRect {
id: lockBg
anchors.fill: parent
color: DynamicColors.palette.m3surface
layer.enabled: true
opacity: DynamicColors.transparency.enabled ? DynamicColors.transparency.base : 1
radius: lockContent.radius
layer.effect: MultiEffect {
blurMax: 15
shadowColor: Qt.alpha(DynamicColors.palette.m3shadow, 0.7)
shadowEnabled: true
}
}
MaterialIcon {
id: lockIcon
anchors.centerIn: parent
font.bold: true
font.pointSize: Appearance.font.size.extraLarge * 4
text: "lock"
}
Content {
id: content
anchors.centerIn: parent
greeter: root.greeter
height: (win.screen?.height ?? 0) * Config.lock.sizes.heightMult - Appearance.padding.large * 2
opacity: 0
scale: 0
screenHeight: win.screen?.height ?? 1440
width: (win.screen?.height ?? 0) * Config.lock.sizes.heightMult * Config.lock.sizes.ratio - Appearance.padding.large * 2
}
}
}
}
}