@@ -458,7 +458,6 @@ def clear_history(self, *args):
458
458
except Exception as e :
459
459
logger .error (f"Error deleting persistent history file: { e } " )
460
460
self .persistent_notifications = []
461
- self .update_separators ()
462
461
self .update_no_notifications_label_visibility ()
463
462
464
463
def _load_persistent_history (self ):
@@ -497,7 +496,6 @@ def delete_historical_notification(self, note_id, container):
497
496
]
498
497
self ._save_persistent_history ()
499
498
container .destroy ()
500
- GLib .idle_add (self .update_separators )
501
499
self .update_no_notifications_label_visibility ()
502
500
503
501
def _add_historical_notification (self , note ):
@@ -618,21 +616,11 @@ def compute_time_label(arrival_time):
618
616
],
619
617
)
620
618
container .add (content_box )
621
- container .add (Box (name = "notification-separator" ))
622
619
self .notifications_list .pack_start (container , False , False , 0 )
623
620
self .notifications_list .reorder_child (container , 0 )
624
- self .update_separators ()
625
621
self .show_all ()
626
622
self .update_no_notifications_label_visibility ()
627
623
628
- def update_last_separator (self ):
629
- children = self .notifications_list .get_children ()
630
- for child in children :
631
- separator = [c for c in child .get_children () if c .get_name () == "notification-separator" ]
632
- if separator :
633
- separator [0 ].set_visible (child != children [- 1 ])
634
-
635
-
636
624
def add_notification (self , notification_box ):
637
625
if len (self .notifications_list .get_children ()) >= 50 :
638
626
oldest_notification_container = self .notifications_list .get_children ()[- 1 ]
@@ -652,7 +640,6 @@ def on_container_destroy(container):
652
640
if hasattr (container , "notification_box" ):
653
641
notif_box = container .notification_box
654
642
container .destroy ()
655
- GLib .idle_add (self .update_separators )
656
643
self .update_no_notifications_label_visibility ()
657
644
658
645
container = Box (
@@ -751,10 +738,8 @@ def compute_time_label(arrival_time):
751
738
lambda * _ : on_container_destroy (container )
752
739
)
753
740
container .add (hist_box )
754
- container .add (Box (name = "notification-separator" ))
755
741
self .notifications_list .pack_start (container , False , False , 0 )
756
742
self .notifications_list .reorder_child (container , 0 )
757
- self .update_separators ()
758
743
self .show_all ()
759
744
self ._append_persistent_notification (notification_box , container .arrival_time )
760
745
self .update_no_notifications_label_visibility ()
@@ -807,18 +792,6 @@ def _cleanup_orphan_cached_images(self):
807
792
else :
808
793
logger .info ("Orphan cached image cleanup finished. No orphan images found." )
809
794
810
-
811
- def update_separators (self ):
812
- children = self .notifications_list .get_children ()
813
- for child in children :
814
- for widget in child .get_children ():
815
- if widget .get_name () == "notification-separator" :
816
- child .remove (widget )
817
- for i , child in enumerate (children ):
818
- if i < len (children ) - 1 :
819
- separator = Box (name = "notification-separator" )
820
- child .add (separator )
821
-
822
795
def update_no_notifications_label_visibility (self ):
823
796
"""Updates the visibility of the 'No notifications!' label based on history."""
824
797
has_notifications = bool (self .notifications_list .get_children ())
0 commit comments