[gnome-contacts: 3/8] Update separators when visibility changes.



commit 6e5b00715cb28577fa18180bd0d62cc683e017bb
Author: Alexander Larsson <alexl redhat com>
Date:   Fri May 25 14:09:55 2012 +0200

    Update separators when visibility changes.

 egg-list-box.vala |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/egg-list-box.vala b/egg-list-box.vala
index 21d1340..2be33a6 100644
--- a/egg-list-box.vala
+++ b/egg-list-box.vala
@@ -787,11 +787,25 @@ public class Egg.ListBox : Container {
       update_separator (iter);
       update_separator (get_next_visible (iter));
     }
+
+    widget.notify["visible"].connect (child_visibility_changed);
+  }
+
+  private void child_visibility_changed (Object object, ParamSpec pspec) {
+    if (this.get_visible ()) {
+      unowned ChildInfo? info = lookup_info (object as Widget);
+      if (info != null) {
+	update_separator (info.iter);
+	update_separator (get_next_visible (info.iter));
+      }
+    }
   }
 
   public override void remove (Widget widget) {
     bool was_visible = widget.get_visible ();
 
+    widget.notify["visible"].disconnect (child_visibility_changed);
+
     unowned ChildInfo? info = lookup_info (widget);
     if (info == null) {
       info = separator_hash.get (widget);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]