diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-15 14:41:44 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-15 14:41:44 +0200 |
| commit | a0528b46c77a6298e88bfd67ce92efffe6f0d6bd (patch) | |
| tree | 3674fdcc5aa235fb1ba32a4e6c7c20958826659f /desktop | |
| parent | 51070241dd0486cb9b69e173586cd32324d9d3a5 (diff) | |
| download | quickshell-a0528b46c77a6298e88bfd67ce92efffe6f0d6bd.tar.gz quickshell-a0528b46c77a6298e88bfd67ce92efffe6f0d6bd.zip | |
feat(desktop): add the notification history page
Reachable only from the reserved space's History button, so it is a drawer
view, not a module and not a tile. Rows are inert; clear-all empties the
ring, since the daemon has no per-id history deletion.
Diffstat (limited to 'desktop')
| -rw-r--r-- | desktop/Drawer.qml | 26 | ||||
| -rw-r--r-- | desktop/NotificationHistory.qml | 70 |
2 files changed, 92 insertions, 4 deletions
diff --git a/desktop/Drawer.qml b/desktop/Drawer.qml index 3a862ba..b39da1f 100644 --- a/desktop/Drawer.qml +++ b/desktop/Drawer.qml @@ -30,8 +30,8 @@ Scope { // Which module's page is showing. Empty means the grid. property string page: "" - // Set by NotificationList's History button. Task 5 reads this to show the - // history view; nothing consumes it yet. + // Set by NotificationList's History button and read by the history view + // loader below; reset when the drawer closes. property bool history: false // The balloons read this to stand down while the drawer holds the space. @@ -70,6 +70,7 @@ Scope { // Reset to the grid: a panel that reopens somewhere unexpected is // worse than one extra click. root.page = ""; + root.history = false; } function toggle(name) { @@ -129,7 +130,8 @@ Scope { // to it. focus: true Keys.onEscapePressed: { - if (root.page) root.page = ""; + if (root.history) root.history = false; + else if (root.page) root.page = ""; else root.close(); } @@ -141,7 +143,7 @@ Scope { Item { anchors.fill: parent anchors.margins: 16 - visible: root.page === "" + visible: root.page === "" && !root.history // The notification engine's space. The live queue lists // here while the drawer is open; the balloons stand down @@ -215,6 +217,22 @@ Scope { } Behavior on opacity { NumberAnimation { duration: 160 } } } + + // --- history view --- + + Loader { + id: historyLoader + anchors.fill: parent + anchors.margins: 16 + active: root.history + sourceComponent: Component { + Page { + title: "History" + NotificationHistory { width: parent.width } + } + } + onLoaded: if (item && item.back) item.back.connect(() => root.history = false) + } } } } diff --git a/desktop/NotificationHistory.qml b/desktop/NotificationHistory.qml new file mode 100644 index 0000000..3fdb85d --- /dev/null +++ b/desktop/NotificationHistory.qml @@ -0,0 +1,70 @@ +// Copyright (C) 2026 Danilo M. <danix@danix.xyz> +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +import QtQuick + +// The history ring: the last 20 dismissed or evicted notifications, newest +// first, with a clear all. Rows are inert; only clear-all removes them, since +// the daemon has no per-id history deletion. +Column { + id: page + + spacing: 4 + + Item { + width: parent.width + height: 28 + + Text { + anchors { left: parent.left; verticalCenter: parent.verticalCenter } + text: Notify.history.length + " in history" + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } + color: Theme.subtext + } + + Text { + id: clearBtn + anchors { right: parent.right; verticalCenter: parent.verticalCenter } + visible: Notify.history.length > 0 + text: "Clear all" + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } + color: clearArea.containsMouse ? Theme.red : Theme.subtext + + MouseArea { + id: clearArea + anchors.fill: parent + anchors.margins: -6 + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: Notify.clearHistory() + } + } + } + + Repeater { + model: Notify.history + + NotificationRow { + required property var modelData + width: page.width + notification: modelData + live: false + } + } + + Text { + width: parent.width + visible: Notify.history.length === 0 + text: "Nothing in history" + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } + color: Theme.overlay + } +} |
