diff --git a/Helpers/IPCHandlers.qml b/Helpers/IPCHandlers.qml index f0659cd..6cc0aea 100644 --- a/Helpers/IPCHandlers.qml +++ b/Helpers/IPCHandlers.qml @@ -6,6 +6,7 @@ IpcHandler { property var appLauncherPanel property var lockScreen property IdleInhibitor idleInhibitor + property var notificationPopup target: "globalIPC" @@ -13,6 +14,12 @@ IpcHandler { idleInhibitor.toggle() } + + function toggleNotificationPopup(): void { + console.log("[IPC] NotificationPopup toggle() called") + notificationPopup.togglePopup(); + } + // Toggle Applauncher visibility function toggleLauncher(): void { if (!appLauncherPanel) { diff --git a/Widgets/Notification/NotificationPopup.qml b/Widgets/Notification/NotificationPopup.qml index b80018f..10324c0 100644 --- a/Widgets/Notification/NotificationPopup.qml +++ b/Widgets/Notification/NotificationPopup.qml @@ -8,11 +8,12 @@ PanelWindow { implicitWidth: 350 implicitHeight: notificationColumn.implicitHeight color: "transparent" - visible: notificationModel.count > 0 + visible: notificationsVisible && notificationModel.count > 0 screen: Quickshell.primaryScreen !== undefined ? Quickshell.primaryScreen : null focusable: false property bool barVisible: true + property bool notificationsVisible: true anchors.top: true anchors.right: true @@ -26,6 +27,12 @@ PanelWindow { property int maxVisible: 5 property int spacing: 5 + function togglePopup(): void { + console.log("[NotificationPopup] Current state: " + notificationsVisible); + notificationsVisible = !notificationsVisible; + console.log("[NotificationPopup] New state: " + notificationsVisible); + } + function addNotification(notification) { notificationModel.insert(0, { id: notification.id, diff --git a/shell.qml b/shell.qml index 74e41ca..6be575b 100644 --- a/shell.qml +++ b/shell.qml @@ -62,7 +62,9 @@ Scope { onNotification: function (notification) { console.log("Notification received:", notification.appName); notification.tracked = true; - notificationPopup.addNotification(notification); + if (notificationPopup.notificationsVisible) { + notificationPopup.addNotification(notification); + } if (notificationHistoryWin) { notificationHistoryWin.addToHistory({ id: notification.id, @@ -96,6 +98,7 @@ Scope { appLauncherPanel: appLauncherPanel lockScreen: lockScreen idleInhibitor: idleInhibitor + notificationPopup: notificationPopup } Connections {