* lock: add fprint support * lock: better fprint detection * lock: cap error retries * nix: fix fprint pam for nix * lock: reset fprint tries * lock: minor pam fixes Delay fprint error retries Reset fprint error retries on lock * lock: loading indicator passwd state Instead of fprint state cause no way of detecting that * dashboard: better visualiser * lock: better fprint availability check * lock: better in/out anim Animating layout sizes is a bad idea :woe: Use scale instead * lock: add better error/fail messages * lock: less fprint icon states Already shown by message * lock: fix fprint reset * lock: include passwd pam * lock: flash message on change * lock: fix message anim Also wrap message instead of eliding * lock: better messages for no fprint
149 lines
4.2 KiB
QML
149 lines
4.2 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import qs.components
|
|
import qs.components.containers
|
|
import qs.components.effects
|
|
import qs.services
|
|
import qs.config
|
|
import Quickshell
|
|
import Quickshell.Widgets
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
|
|
ColumnLayout {
|
|
id: root
|
|
|
|
required property var lock
|
|
|
|
anchors.fill: parent
|
|
anchors.margins: Appearance.padding.large
|
|
|
|
spacing: Appearance.spacing.smaller
|
|
|
|
StyledText {
|
|
Layout.fillWidth: true
|
|
text: Notifs.list.length > 0 ? qsTr("%1 notification%2").arg(Notifs.list.length).arg(Notifs.list.length === 1 ? "" : "s") : qsTr("Notifications")
|
|
color: Colours.palette.m3outline
|
|
font.family: Appearance.font.family.mono
|
|
font.weight: 500
|
|
elide: Text.ElideRight
|
|
}
|
|
|
|
ClippingRectangle {
|
|
id: clipRect
|
|
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
|
|
radius: Appearance.rounding.small
|
|
color: "transparent"
|
|
|
|
Loader {
|
|
anchors.centerIn: parent
|
|
asynchronous: true
|
|
active: opacity > 0
|
|
opacity: Notifs.list.length > 0 ? 0 : 1
|
|
|
|
sourceComponent: ColumnLayout {
|
|
spacing: Appearance.spacing.large
|
|
|
|
Image {
|
|
asynchronous: true
|
|
source: `file://${Quickshell.shellDir}/assets/dino.png`
|
|
fillMode: Image.PreserveAspectFit
|
|
sourceSize.width: clipRect.width * 0.8
|
|
|
|
layer.enabled: true
|
|
layer.effect: Colouriser {
|
|
colorizationColor: Colours.palette.m3outlineVariant
|
|
brightness: 1
|
|
}
|
|
}
|
|
|
|
StyledText {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
text: qsTr("No Notifications")
|
|
color: Colours.palette.m3outlineVariant
|
|
font.pointSize: Appearance.font.size.large
|
|
font.family: Appearance.font.family.mono
|
|
font.weight: 500
|
|
}
|
|
}
|
|
|
|
Behavior on opacity {
|
|
Anim {
|
|
duration: Appearance.anim.durations.extraLarge
|
|
}
|
|
}
|
|
}
|
|
|
|
StyledListView {
|
|
anchors.fill: parent
|
|
|
|
spacing: Appearance.spacing.small
|
|
clip: true
|
|
|
|
model: ScriptModel {
|
|
values: [...new Set(Notifs.list.map(notif => notif.appName))].reverse()
|
|
}
|
|
|
|
delegate: NotifGroup {}
|
|
|
|
add: Transition {
|
|
Anim {
|
|
property: "opacity"
|
|
from: 0
|
|
to: 1
|
|
}
|
|
Anim {
|
|
property: "scale"
|
|
from: 0
|
|
to: 1
|
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
|
}
|
|
}
|
|
|
|
remove: Transition {
|
|
Anim {
|
|
property: "opacity"
|
|
to: 0
|
|
}
|
|
Anim {
|
|
property: "scale"
|
|
to: 0.6
|
|
}
|
|
}
|
|
|
|
move: Transition {
|
|
Anim {
|
|
properties: "opacity,scale"
|
|
to: 1
|
|
}
|
|
Anim {
|
|
property: "y"
|
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
|
}
|
|
}
|
|
|
|
displaced: Transition {
|
|
Anim {
|
|
properties: "opacity,scale"
|
|
to: 1
|
|
}
|
|
Anim {
|
|
property: "y"
|
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
component Anim: NumberAnimation {
|
|
duration: Appearance.anim.durations.normal
|
|
easing.type: Easing.BezierSpline
|
|
easing.bezierCurve: Appearance.anim.curves.standard
|
|
}
|
|
}
|