diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-10 18:38:00 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-10 18:38:00 +1000 |
| commit | 8c2bda4cff97eea165c90c967a4054c1bf2167da (patch) | |
| tree | 3936fa12b72f072fe587f549a74b92d1ed8b2136 /modules | |
| parent | feat: basic notifications (diff) | |
| download | caelestia-shell-8c2bda4cff97eea165c90c967a4054c1bf2167da.tar.gz caelestia-shell-8c2bda4cff97eea165c90c967a4054c1bf2167da.tar.bz2 caelestia-shell-8c2bda4cff97eea165c90c967a4054c1bf2167da.zip | |
notifs: actual list
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/notifications/Content.qml | 75 | ||||
| -rw-r--r-- | modules/notifications/Notifications.qml | 2 | ||||
| -rw-r--r-- | modules/notifications/Wrapper.qml | 2 |
3 files changed, 71 insertions, 8 deletions
diff --git a/modules/notifications/Content.qml b/modules/notifications/Content.qml index 7fdd000..7002dc5 100644 --- a/modules/notifications/Content.qml +++ b/modules/notifications/Content.qml @@ -3,22 +3,85 @@ import "root:/services" import "root:/config" import Quickshell import QtQuick +import QtQuick.Controls -Column { +Item { id: root - padding: Appearance.padding.large + readonly property int padding: Appearance.padding.large anchors.bottom: parent.bottom anchors.right: parent.right - spacing: Appearance.spacing.normal + implicitWidth: NotifsConfig.sizes.width + root.padding * 2 + implicitHeight: list.height + root.padding * 2 + + ListView { + id: list - Repeater { model: ScriptModel { - values: [...Notifs.list] + values: [...Notifs.popups].reverse() + } + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: root.padding + + clip: true + implicitHeight: { + let height = (count - 1) * spacing; + for (let i = 0; i < count; i++) + height += itemAtIndex(i).height; + return height; + } + + orientation: Qt.Vertical + spacing: Appearance.spacing.smaller + + delegate: Notification {} + + ScrollBar.vertical: StyledScrollBar {} + + add: Transition { + Anim { + property: "x" + from: NotifsConfig.sizes.width + to: 0 + duration: Appearance.anim.durations.large + easing.bezierCurve: Appearance.anim.curves.emphasizedDecel + } } - Notification {} + remove: Transition { + Anim { + property: "x" + from: 0 + to: NotifsConfig.sizes.width + easing.bezierCurve: Appearance.anim.curves.emphasizedAccel + } + } + + move: Transition { + Anim { + property: "y" + } + } + + displaced: Transition { + Anim { + property: "y" + } + } + + Behavior on implicitHeight { + Anim {} + } + } + + component Anim: NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard } } diff --git a/modules/notifications/Notifications.qml b/modules/notifications/Notifications.qml index fa01d33..52f2a7f 100644 --- a/modules/notifications/Notifications.qml +++ b/modules/notifications/Notifications.qml @@ -12,7 +12,7 @@ Variants { id: root required property ShellScreen modelData - property bool osdVisible: Notifs.list.length > 0 + property bool osdVisible: Notifs.popups.length > 0 LazyLoader { loading: true diff --git a/modules/notifications/Wrapper.qml b/modules/notifications/Wrapper.qml index 1d650f6..a98ab4b 100644 --- a/modules/notifications/Wrapper.qml +++ b/modules/notifications/Wrapper.qml @@ -50,7 +50,7 @@ Item { property: "height" duration: Appearance.anim.durations.normal easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.emphasizedAccel + easing.bezierCurve: Appearance.anim.curves.standard } PropertyAction { target: root |