[gnome-boxes] empty-boxes: Hook to correct signal for updating visibility



commit d69a59413504b7d2fdcb9a2d10f20c3fcd267d65
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Feb 17 17:59:52 2014 +0000

    empty-boxes: Hook to correct signal for updating visibility

 src/empty-boxes.vala |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/empty-boxes.vala b/src/empty-boxes.vala
index 9246505..168cf8d 100644
--- a/src/empty-boxes.vala
+++ b/src/empty-boxes.vala
@@ -17,17 +17,19 @@ private class Boxes.EmptyBoxes : Gtk.Grid, Boxes.UI {
         gtk_actor.x_expand = true;
         gtk_actor.y_expand = true;
 
+        App.app.call_when_ready (on_app_ready);
+    }
+
+    private void on_app_ready () {
+        update_visibility ();
+
         App.app.collection.item_added.connect (update_visibility);
         App.app.collection.item_removed.connect (update_visibility);
-
-        notify["ui-state"].connect (update_visibility);
     }
 
     private void update_visibility () {
-        App.app.call_when_ready (() => {
-            var visible = ui_state == UIState.COLLECTION && App.app.collection.items.length == 0;
-            if (visible != gtk_actor.visible)
-                fade_actor (gtk_actor, visible? 255 : 0);
-        });
+        var visible = ui_state == UIState.COLLECTION && App.app.collection.items.length == 0;
+        if (visible != gtk_actor.visible)
+            fade_actor (gtk_actor, visible? 255 : 0);
     }
 }


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