From d2747e2ca1e211a32e91e44010f40a00e0ac97e4 Mon Sep 17 00:00:00 2001 From: Leander Scherer Date: Sat, 30 May 2026 15:35:27 +0200 Subject: feat(quickshell): add popup controls and privacy indicators --- modules/system/quickshell/GlobalState.qml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'modules/system/quickshell/GlobalState.qml') 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 = []; } } -- cgit v1.3.1