[gnome-games] collection-view: Ensure we the collection is shown



commit 32756795e7c4c666d8e5812ca76f3615b8a5d743
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Feb 11 04:15:09 2020 +0500

    collection-view: Ensure we the collection is shown
    
    Add sync-create to some bindings and remove an extra
    is_collection_empty = true.
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-games/issues/245

 src/ui/collection-view.vala | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/ui/collection-view.vala b/src/ui/collection-view.vala
index 259f0121..f17b6289 100644
--- a/src/ui/collection-view.vala
+++ b/src/ui/collection-view.vala
@@ -53,13 +53,12 @@ private class Games.CollectionView : Object, UiView {
                        game_activated (game);
                });
 
+               is_collection_empty = game_model.get_n_items () == 0;
                game_model.items_changed.connect (() => {
                        is_collection_empty = game_model.get_n_items () == 0;
                });
-               is_collection_empty = game_model.get_n_items () == 0;
 
                header_bar.viewstack = box.viewstack;
-               is_collection_empty = true;
 
                bind_property ("loading-notification", box,
                               "loading-notification", BindingFlags.DEFAULT);
@@ -70,9 +69,9 @@ private class Games.CollectionView : Object, UiView {
                               "search-mode", BindingFlags.BIDIRECTIONAL);
 
                bind_property ("is-collection-empty", box,
-                              "is-collection-empty", BindingFlags.BIDIRECTIONAL);
+                              "is-collection-empty", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE);
                bind_property ("is-collection-empty", header_bar,
-                              "is-collection-empty", BindingFlags.BIDIRECTIONAL);
+                              "is-collection-empty", BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE);
 
                bind_property ("is-folded", box,
                               "is-folded", BindingFlags.BIDIRECTIONAL);


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