From 3832c561c92322f1dcd7f35aa93fbbc66660ada2 Mon Sep 17 00:00:00 2001 From: tr1x_em Date: Sat, 9 Aug 2025 20:50:52 +0530 Subject: [PATCH] Fix Expanded Notifiaction Not Showing --- modules/notification/notification_center.py | 34 +++++++++++++-------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/modules/notification/notification_center.py b/modules/notification/notification_center.py index a513d11..4049dfb 100644 --- a/modules/notification/notification_center.py +++ b/modules/notification/notification_center.py @@ -29,13 +29,13 @@ class ExpandableNotificationGroup(Box): self.app_name = app_name self.notifications = notifications self.is_expanded = False # Always start collapsed - + # Create collapsed state first (shows only latest notification) self.create_collapsed_state() - - # Create expanded state (hidden initially) + + # Create expanded state (hidden initially) self.create_expanded_state() - + # Ensure we start in collapsed state self.collapsed_eventbox.set_visible(True) self.expanded_box.set_visible(False) @@ -105,7 +105,9 @@ class ExpandableNotificationGroup(Box): icon_name="close-symbolic", icon_size=18 ), visible=True, - on_clicked=lambda *_: self._close_single_notification_and_stop_propagation(latest_notification), + on_clicked=lambda *_: self._close_single_notification_and_stop_propagation( + latest_notification + ), ), Box(v_expand=True), ], @@ -189,13 +191,15 @@ class ExpandableNotificationGroup(Box): icon_name="close-symbolic", icon_size=18 ), visible=True, - on_clicked=lambda *_: self._close_single_notification_and_stop_propagation(latest_notification), + on_clicked=lambda *_: self._close_single_notification_and_stop_propagation( + latest_notification + ), ), Label( name="notification-count-label", label=f"{len(self.notifications)}", h_align="end", - ) + ), ], ), ], @@ -285,9 +289,13 @@ class ExpandableNotificationGroup(Box): return get_fallback_notification_icon((35, 35)) def on_clicked(self, widget, event): - logger.debug(f"Notification group clicked: {self.app_name}, button: {event.button}") + logger.debug( + f"Notification group clicked: {self.app_name}, button: {event.button}" + ) if event.button == 1: # Left click - if len(self.notifications) > 1: # Only expand if there are multiple notifications + if ( + len(self.notifications) > 1 + ): # Only expand if there are multiple notifications self.expand() else: logger.debug("Single notification group - no expansion needed") @@ -322,7 +330,7 @@ class ExpandableNotificationGroup(Box): logger.error( f"Error removing notification {notification.cache_id}: {e}" ) - + def _close_single_notification(self, notification): """Close a single notification from this group""" try: @@ -335,8 +343,10 @@ class ExpandableNotificationGroup(Box): notification_service.remove_cached_notification(notification.cache_id) logger.debug(f"Closed single notification: {notification.cache_id}") except Exception as e: - logger.error(f"Error removing single notification {notification.cache_id}: {e}") - + logger.error( + f"Error removing single notification {notification.cache_id}: {e}" + ) + def _close_single_notification_and_stop_propagation(self, notification): """Close notification and prevent click from expanding the group""" self._close_single_notification(notification)