diff options
| author | Leander Scherer <leander@schererleander.de> | 2026-05-30 15:35:27 +0200 |
|---|---|---|
| committer | Leander Scherer <leander@schererleander.de> | 2026-05-30 15:35:27 +0200 |
| commit | d2747e2ca1e211a32e91e44010f40a00e0ac97e4 (patch) | |
| tree | fb229d6a18541c7a5f1944390b21edde028955f9 /modules/system/quickshell/GlobalState.qml | |
| parent | 51b3cbd50b92d026549ce3ebff17ca9b3344f441 (diff) | |
feat(quickshell): add popup controls and privacy indicators
Diffstat (limited to 'modules/system/quickshell/GlobalState.qml')
| -rw-r--r-- | modules/system/quickshell/GlobalState.qml | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/modules/system/quickshell/GlobalState.qml b/modules/system/quickshell/GlobalState.qml index c212967..c657b31 100644 --- a/modules/system/quickshell/GlobalState.qml +++ b/modules/system/quickshell/GlobalState.qml @@ -1,23 +1,32 @@ -import QtQuick - pragma Singleton +import QtQuick -// Shared state to coordinate which popup is currently open. -// Ensures only one menu is visible at a time. QtObject { property string activePopup: "" + property var notificationHistory: [] function open(name) { - activePopup = "" - activePopup = name + activePopup = ""; + activePopup = name; } function close() { - activePopup = "" + activePopup = ""; } function toggle(name) { - if (activePopup === name) activePopup = "" - else activePopup = name + if (activePopup === name) + activePopup = ""; + else + activePopup = name; + } + + function addNotification(data) { + const entry = Object.assign({}, data); + notificationHistory = [entry].concat(notificationHistory).slice(0, 50); + } + + function clearNotificationHistory() { + notificationHistory = []; } } |
