diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-07-09 21:48:28 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-07-09 21:48:28 +1000 |
| commit | fbb939403832b0860302f1b400ad021794e1fadb (patch) | |
| tree | 06e116a06f6ac6845ec04bcfd9f74eef8e7aa2b1 /modules/notifications/Content.qml | |
| parent | lock: fix notifs height on startup (diff) | |
| download | caelestia-shell-fbb939403832b0860302f1b400ad021794e1fadb.tar.gz caelestia-shell-fbb939403832b0860302f1b400ad021794e1fadb.tar.bz2 caelestia-shell-fbb939403832b0860302f1b400ad021794e1fadb.zip | |
notifs: add indicators for offscreen notifs
Diffstat (limited to 'modules/notifications/Content.qml')
| -rw-r--r-- | modules/notifications/Content.qml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/modules/notifications/Content.qml b/modules/notifications/Content.qml index 6983b95..108f8d3 100644 --- a/modules/notifications/Content.qml +++ b/modules/notifications/Content.qml @@ -147,6 +147,48 @@ Item { property: "y" } } + + ExtraIndicator { + anchors.top: parent.top + extra: { + const count = list.count; + if (count === 0) + return 0; + + const scrollY = list.contentY; + + let height = 0; + for (let i = 0; i < count; i++) { + height += (list.itemAtIndex(i)?.nonAnimHeight ?? 0) + Appearance.spacing.smaller; + + if (height - Appearance.spacing.smaller >= scrollY) + return i; + } + + return count; + } + } + + ExtraIndicator { + anchors.bottom: parent.bottom + extra: { + const count = list.count; + if (count === 0) + return 0; + + const scrollY = list.contentHeight - (list.contentY + list.height); + + let height = 0; + for (let i = count - 1; i >= 0; i--) { + height += (list.itemAtIndex(i)?.nonAnimHeight ?? 0) + Appearance.spacing.smaller; + + if (height - Appearance.spacing.smaller >= scrollY) + return count - i - 1; + } + + return 0; + } + } } } |