Files
mxandClaude Opus 5.5 b96b0cb683 Turn the lock screen into an unfolding glass dashboard
At rest the lock screen shows the date, glass clock and Now Playing. Typing
or clicking opens a glass card with avatar, name, status and password, then
wings unfold: weather (with the next forecasts) and system usage on the
left, notifications and media with Cava on the right, reusing the desktop
widget faces. Adds a Caps Lock warning, power controls behind a corner
button, and Dashboard and Notification previews settings. The screenshot
backdrop is now always fully blurred and dimmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 18:07:46 +02:00

164 lines
6.1 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import Quickshell
import "../services"
import "../theme"
// Notifications on the lock screen, newest first. Read-only: nothing can be
// opened or acted on while locked, and bodies show only with previews on.
ColumnLayout {
id: root
property real unit: 1
function s(value) {
return Math.round(value * unit);
}
readonly property bool previews: LockState.options.notificationPreviews
spacing: s(10)
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: root.s(4)
spacing: root.s(8)
Text {
text: "Notifications"
color: "#ffffff"
font.pixelSize: root.s(13)
font.weight: Font.DemiBold
Layout.fillWidth: true
}
Text {
visible: NotificationService.dnd
text: Icons.available ? "󰽥" : "Do Not Disturb"
font.family: Icons.available ? Icons.family : ""
color: Qt.alpha("#ffffff", 0.6)
font.pixelSize: root.s(13)
}
Rectangle {
visible: list.count > 0
implicitWidth: Math.max(height, countText.implicitWidth + root.s(12))
implicitHeight: root.s(20)
radius: height / 2
color: Qt.alpha("#ffffff", 0.14)
Text {
id: countText
anchors.centerIn: parent
text: list.count
color: "#ffffff"
font.pixelSize: root.s(11)
font.weight: Font.DemiBold
}
}
}
ListView {
id: list
objectName: "lockNotifications"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
spacing: root.s(8)
boundsBehavior: Flickable.StopAtBounds
model: ScriptModel {
values: NotificationService.active ? NotificationService.list : []
}
delegate: Rectangle {
id: card
required property var modelData
readonly property string icon: NotificationService.iconFor(modelData)
width: list.width
height: row.implicitHeight + root.s(20)
radius: root.s(14)
color: Qt.alpha("#ffffff", 0.08)
border.width: NotificationService.critical(modelData) ? 1 : 0
border.color: Qt.alpha(Theme.urgent, 0.6)
RowLayout {
id: row
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: root.s(10)
spacing: root.s(10)
Item {
Layout.alignment: Qt.AlignTop
Layout.preferredWidth: root.s(30)
Layout.preferredHeight: root.s(30)
Image {
id: appIcon
anchors.fill: parent
source: card.icon
sourceSize: Qt.size(64, 64)
fillMode: Image.PreserveAspectFit
asynchronous: true
visible: status === Image.Ready
}
Rectangle {
anchors.fill: parent
visible: appIcon.status !== Image.Ready
radius: root.s(8)
color: Qt.alpha("#ffffff", 0.15)
Text {
anchors.centerIn: parent
text: NotificationService.appLabel(card.modelData).charAt(0).toUpperCase()
color: "#ffffff"
font.pixelSize: root.s(13)
font.weight: Font.DemiBold
}
}
}
ColumnLayout {
Layout.fillWidth: true
spacing: root.s(2)
RowLayout {
Layout.fillWidth: true
spacing: root.s(6)
Text {
text: NotificationService.appLabel(card.modelData)
color: Qt.alpha("#ffffff", 0.7)
font.pixelSize: root.s(11)
font.weight: Font.DemiBold
elide: Text.ElideRight
textFormat: Text.PlainText
Layout.fillWidth: true
}
Text {
text: NotificationService.since(card.modelData)
color: Qt.alpha("#ffffff", 0.5)
font.pixelSize: root.s(10)
}
}
Text {
text: card.modelData.summary
color: "#ffffff"
font.pixelSize: root.s(12)
font.weight: Font.DemiBold
elide: Text.ElideRight
textFormat: Text.PlainText
Layout.fillWidth: true
}
Text {
visible: root.previews && text !== ""
text: card.modelData.body
color: Qt.alpha("#ffffff", 0.75)
font.pixelSize: root.s(11)
textFormat: Text.StyledText
wrapMode: Text.Wrap
maximumLineCount: 2
elide: Text.ElideRight
Layout.fillWidth: true
}
}
}
}
Text {
anchors.centerIn: parent
width: parent.width - root.s(24)
visible: list.count === 0
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
text: NotificationService.active ? "No Notifications" : NotificationService.notice || "Notifications are off"
color: Qt.alpha("#ffffff", 0.55)
font.pixelSize: root.s(12)
}
}
}