C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 9s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Failing after 33s
Rust / build (pull_request) Successful in 48s
Python / verify (pull_request) Failing after 1m24s
Rust / fmt (pull_request) Successful in 32s
Rust / clippy (pull_request) Successful in 57s
124 lines
2.4 KiB
QML
124 lines
2.4 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import Quickshell
|
|
import Quickshell.Widgets
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import qs.Modules
|
|
import qs.Components
|
|
import qs.Helpers
|
|
import ZShell.Config
|
|
import qs.Daemons
|
|
import qs.Services
|
|
|
|
ColumnLayout {
|
|
id: root
|
|
|
|
required property var lock
|
|
|
|
anchors.fill: parent
|
|
anchors.margins: Tokens.padding.large
|
|
spacing: Tokens.spacing.small
|
|
|
|
CustomText {
|
|
Layout.fillWidth: true
|
|
color: Colors.palette.m3outline
|
|
elide: Text.ElideRight
|
|
font: Tokens.font.mono.builders.small.weight(Font.Medium).build()
|
|
text: NotifServer.list.length > 0 ? qsTr("%1 notification%2").arg(NotifServer.list.length).arg(NotifServer.list.length === 1 ? "" : "s") : qsTr("Notifications")
|
|
}
|
|
|
|
Item {
|
|
id: clipRect
|
|
|
|
Layout.fillHeight: true
|
|
Layout.fillWidth: true
|
|
|
|
Loader {
|
|
active: opacity > 0
|
|
anchors.centerIn: parent
|
|
opacity: NotifServer.list.length > 0 ? 0 : 1
|
|
|
|
Behavior on opacity {
|
|
Anim {
|
|
duration: Tokens.anim.durations.extraLarge
|
|
}
|
|
}
|
|
sourceComponent: ColumnLayout {
|
|
spacing: Tokens.spacing.largeIncreased
|
|
|
|
CustomText {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
color: Colors.palette.m3outlineVariant
|
|
font: Tokens.font.headline.builders.small.width(90).build()
|
|
text: qsTr("No Notifications")
|
|
}
|
|
}
|
|
}
|
|
|
|
CustomListView {
|
|
anchors.fill: parent
|
|
clip: true
|
|
spacing: Tokens.spacing.small
|
|
|
|
add: Transition {
|
|
Anim {
|
|
from: 0
|
|
property: "opacity"
|
|
to: 1
|
|
}
|
|
|
|
Anim {
|
|
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
|
easing: Tokens.anim.expressiveDefaultSpatial
|
|
from: 0
|
|
property: "scale"
|
|
to: 1
|
|
}
|
|
}
|
|
delegate: NotifGroup {}
|
|
displaced: Transition {
|
|
Anim {
|
|
properties: "opacity,scale"
|
|
to: 1
|
|
}
|
|
|
|
Anim {
|
|
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
|
easing: Tokens.anim.expressiveDefaultSpatial
|
|
property: "y"
|
|
}
|
|
}
|
|
model: ScriptModel {
|
|
values: {
|
|
const list = NotifServer.notClosed.map(n => [n.appName, null]);
|
|
return [...new Map(list).keys()];
|
|
}
|
|
}
|
|
move: Transition {
|
|
Anim {
|
|
properties: "opacity,scale"
|
|
to: 1
|
|
}
|
|
|
|
Anim {
|
|
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
|
easing: Tokens.anim.expressiveDefaultSpatial
|
|
property: "y"
|
|
}
|
|
}
|
|
remove: Transition {
|
|
Anim {
|
|
property: "opacity"
|
|
to: 0
|
|
}
|
|
|
|
Anim {
|
|
property: "scale"
|
|
to: 0.6
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|