Fix Expanded Notifiaction Not Showing
This commit is contained in:
1 parent
217e0f6936
commit
3832c561c9
1 file changed
+16
-6
@@ -105,7 +105,9 @@ class ExpandableNotificationGroup(Box):
|
|||||||
icon_name="close-symbolic", icon_size=18
|
icon_name="close-symbolic", icon_size=18
|
||||||
),
|
),
|
||||||
visible=True,
|
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),
|
Box(v_expand=True),
|
||||||
],
|
],
|
||||||
@@ -189,13 +191,15 @@ class ExpandableNotificationGroup(Box):
|
|||||||
icon_name="close-symbolic", icon_size=18
|
icon_name="close-symbolic", icon_size=18
|
||||||
),
|
),
|
||||||
visible=True,
|
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(
|
Label(
|
||||||
name="notification-count-label",
|
name="notification-count-label",
|
||||||
label=f"{len(self.notifications)}",
|
label=f"{len(self.notifications)}",
|
||||||
h_align="end",
|
h_align="end",
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -285,9 +289,13 @@ class ExpandableNotificationGroup(Box):
|
|||||||
return get_fallback_notification_icon((35, 35))
|
return get_fallback_notification_icon((35, 35))
|
||||||
|
|
||||||
def on_clicked(self, widget, event):
|
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 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()
|
self.expand()
|
||||||
else:
|
else:
|
||||||
logger.debug("Single notification group - no expansion needed")
|
logger.debug("Single notification group - no expansion needed")
|
||||||
@@ -335,7 +343,9 @@ class ExpandableNotificationGroup(Box):
|
|||||||
notification_service.remove_cached_notification(notification.cache_id)
|
notification_service.remove_cached_notification(notification.cache_id)
|
||||||
logger.debug(f"Closed single notification: {notification.cache_id}")
|
logger.debug(f"Closed single notification: {notification.cache_id}")
|
||||||
except Exception as e:
|
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):
|
def _close_single_notification_and_stop_propagation(self, notification):
|
||||||
"""Close notification and prevent click from expanding the group"""
|
"""Close notification and prevent click from expanding the group"""
|
||||||
|
|||||||
Reference in new issue
Block a user