lock: own backdrop with wallpaper option, am/pm clock
The session-lock surface was transparent with nothing painting behind it. TouchLockSurface now owns its backdrop: lock.wallpaperPath when pinned, else the system wallpaper, else a dark field — plus a scrim for glance legibility. Glance clock gains lock.twelveHourClock (default on, h:mm ap). LockConfig grows the wallpaper picker (same FolderListModel grid as the wallpaper page, no matugen side effects) and the 12-hour switch.
This commit is contained in:
parent
d824ca7f81
commit
5083954c38
4 changed files with 116 additions and 1 deletions
|
|
@ -457,6 +457,11 @@ Singleton {
|
||||||
property real extraZoom: 1.1
|
property real extraZoom: 1.1
|
||||||
}
|
}
|
||||||
property bool centerClock: true
|
property bool centerClock: true
|
||||||
|
// 12-hour glance clock (am/pm). Off = 24-hour.
|
||||||
|
property bool twelveHourClock: true
|
||||||
|
// Lock-screen wallpaper. Empty = follow the system wallpaper
|
||||||
|
// (background.wallpaperPath); a path pins the lock's own.
|
||||||
|
property string wallpaperPath: ""
|
||||||
property bool showLockedText: true
|
property bool showLockedText: true
|
||||||
// Souveraine-owned lock cards. Transport controls are
|
// Souveraine-owned lock cards. Transport controls are
|
||||||
// ambient; media metadata remains personal by default.
|
// ambient; media metadata remains personal by default.
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,35 @@ MouseArea {
|
||||||
property real dragOffset: 0
|
property real dragOffset: 0
|
||||||
readonly property real commitDistance: 120
|
readonly property real commitDistance: 120
|
||||||
|
|
||||||
|
// Lock wallpaper. The session-lock surface is transparent and nothing
|
||||||
|
// else paints behind this MouseArea, so the surface owns its own
|
||||||
|
// backdrop: the lock's pinned wallpaper when set, else the system
|
||||||
|
// wallpaper, else a plain dark field. The scrim keeps the glance text
|
||||||
|
// readable over any image.
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
z: -3
|
||||||
|
color: "#0b0d10"
|
||||||
|
}
|
||||||
|
Image {
|
||||||
|
anchors.fill: parent
|
||||||
|
z: -2
|
||||||
|
source: {
|
||||||
|
const p = Config.options.lock.wallpaperPath
|
||||||
|
|| Config.options.background.wallpaperPath || "";
|
||||||
|
return p ? "file://" + p : "";
|
||||||
|
}
|
||||||
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
asynchronous: true
|
||||||
|
visible: status === Image.Ready
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
z: -1
|
||||||
|
color: "#000000"
|
||||||
|
opacity: 0.32
|
||||||
|
}
|
||||||
|
|
||||||
function forceFieldFocus() {
|
function forceFieldFocus() {
|
||||||
root.forceActiveFocus();
|
root.forceActiveFocus();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Qt.labs.folderlistmodel
|
||||||
|
import Quickshell
|
||||||
import qs.services
|
import qs.services
|
||||||
import qs.modules.common
|
import qs.modules.common
|
||||||
import qs.modules.common.widgets
|
import qs.modules.common.widgets
|
||||||
|
|
@ -89,6 +91,15 @@ ContentPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConfigSwitch {
|
||||||
|
buttonIcon: "schedule"
|
||||||
|
text: Translation.tr("12-hour clock (am/pm)")
|
||||||
|
checked: Config.options.lock.twelveHourClock
|
||||||
|
onCheckedChanged: {
|
||||||
|
Config.options.lock.twelveHourClock = checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ConfigSwitch {
|
ConfigSwitch {
|
||||||
buttonIcon: "text_fields"
|
buttonIcon: "text_fields"
|
||||||
text: Translation.tr("Show locked text")
|
text: Translation.tr("Show locked text")
|
||||||
|
|
@ -117,6 +128,74 @@ ContentPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ContentSection {
|
||||||
|
id: lockWallSection
|
||||||
|
icon: "wallpaper"
|
||||||
|
title: Translation.tr("Lock screen wallpaper")
|
||||||
|
|
||||||
|
readonly property string wallpaperDir: Quickshell.env("HOME") + "/Pictures/Wallpapers"
|
||||||
|
|
||||||
|
ConfigSwitch {
|
||||||
|
buttonIcon: "sync"
|
||||||
|
text: Translation.tr("Follow system wallpaper")
|
||||||
|
checked: !Config.options.lock.wallpaperPath
|
||||||
|
onCheckedChanged: {
|
||||||
|
if (checked) Config.options.lock.wallpaperPath = "";
|
||||||
|
}
|
||||||
|
StyledToolTip {
|
||||||
|
text: Translation.tr("The lock screen shows the same wallpaper as the shell. Pick an image below to pin the lock screen's own.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GridView {
|
||||||
|
id: lockWallGrid
|
||||||
|
Layout.fillWidth: true
|
||||||
|
readonly property int cols: 3
|
||||||
|
cellWidth: Math.floor(width / cols)
|
||||||
|
cellHeight: Math.floor(cellWidth * 2)
|
||||||
|
implicitHeight: Math.ceil(lockWallModel.count / cols) * cellHeight
|
||||||
|
interactive: false
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
model: FolderListModel {
|
||||||
|
id: lockWallModel
|
||||||
|
folder: "file://" + lockWallSection.wallpaperDir
|
||||||
|
nameFilters: ["*.jpg", "*.jpeg", "*.png", "*.webp"]
|
||||||
|
showDirs: false
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate: Item {
|
||||||
|
required property string filePath
|
||||||
|
width: lockWallGrid.cellWidth
|
||||||
|
height: lockWallGrid.cellHeight
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: 5
|
||||||
|
radius: Appearance.rounding.small
|
||||||
|
color: Appearance.colors.colLayer1
|
||||||
|
border.width: Config.options.lock.wallpaperPath === filePath ? 3 : 0
|
||||||
|
border.color: Appearance.colors.colPrimary
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
Image {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: 3
|
||||||
|
source: "file://" + filePath
|
||||||
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
asynchronous: true
|
||||||
|
sourceSize.width: 240
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: Config.options.lock.wallpaperPath = filePath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ContentSection {
|
ContentSection {
|
||||||
icon: "visibility"
|
icon: "visibility"
|
||||||
title: Translation.tr("Lock screen content")
|
title: Translation.tr("Lock screen content")
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell.Services.UPower
|
import Quickshell.Services.UPower
|
||||||
import qs.services
|
import qs.services
|
||||||
|
import qs.modules.common
|
||||||
import "."
|
import "."
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -34,7 +35,8 @@ Item {
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: Qt.formatTime(clock.now, "hh:mm")
|
text: Qt.formatTime(clock.now,
|
||||||
|
Config.options.lock.twelveHourClock ? "h:mm ap" : "hh:mm")
|
||||||
color: "white"
|
color: "white"
|
||||||
font.pixelSize: root.compact ? 60 : 76
|
font.pixelSize: root.compact ? 60 : 76
|
||||||
font.weight: Font.Light
|
font.weight: Font.Light
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue