[gnome-games] ui: Remove empty state from CollectionIconView



commit 7d64f7f4d0ac6a36f655892f835b86672b3177ed
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Mon Aug 6 20:56:52 2018 +0500

    ui: Remove empty state from CollectionIconView
    
    Since there is now a global empty state, this one is not needed anymore.

 data/ui/collection-icon-view.ui  | 13 +------------
 src/ui/collection-icon-view.vala | 13 +------------
 2 files changed, 2 insertions(+), 24 deletions(-)
---
diff --git a/data/ui/collection-icon-view.ui b/data/ui/collection-icon-view.ui
index 3912798b..49b2449b 100644
--- a/data/ui/collection-icon-view.ui
+++ b/data/ui/collection-icon-view.ui
@@ -1,17 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.16"/>
-  <template class="GamesCollectionIconView" parent="GtkStack">
+  <template class="GamesCollectionIconView" parent="GtkBin">
     <property name="visible">True</property>
     <signal name="size-allocate" after="no" handler="on_size_allocate"/>
-    <child>
-      <object class="GamesEmptyCollection" id="empty_collection">
-        <property name="visible">True</property>
-      </object>
-      <packing>
-        <property name="name">empty-collection</property>
-      </packing>
-    </child>
     <child>
       <object class="GtkScrolledWindow" id="scrolled_window">
         <property name="visible">True</property>
@@ -38,9 +30,6 @@
           </object>
         </child>
       </object>
-      <packing>
-        <property name="name">collection-view</property>
-      </packing>
     </child>
   </template>
   <object class="GamesGamepadBrowse" id="gamepad_browse">
diff --git a/src/ui/collection-icon-view.vala b/src/ui/collection-icon-view.vala
index a740c950..7ac0b978 100644
--- a/src/ui/collection-icon-view.vala
+++ b/src/ui/collection-icon-view.vala
@@ -1,7 +1,7 @@
 // This file is part of GNOME Games. License: GPL-3.0+.
 
 [GtkTemplate (ui = "/org/gnome/Games/ui/collection-icon-view.ui")]
-private class Games.CollectionIconView : Gtk.Stack {
+private class Games.CollectionIconView : Gtk.Bin {
        public signal void game_activated (Game game);
 
        private string[] filtering_terms;
@@ -53,8 +53,6 @@ private class Games.CollectionIconView : Gtk.Stack {
                }
        }
 
-       [GtkChild]
-       private EmptyCollection empty_collection;
        [GtkChild]
        private Gtk.ScrolledWindow scrolled_window;
        [GtkChild]
@@ -176,8 +174,6 @@ private class Games.CollectionIconView : Gtk.Stack {
                        var game = model.get_item (i) as Game;
                        add_game (game);
                }
-
-               update_collection ();
        }
 
        private void add_game (Game game) {
@@ -238,13 +234,6 @@ private class Games.CollectionIconView : Gtk.Stack {
                return game1.name.collate (game2.name);
        }
 
-       private void update_collection () {
-               if (model.get_n_items () == 0)
-                       set_visible_child (empty_collection);
-               else
-                       set_visible_child (scrolled_window);
-       }
-
        [GtkCallback]
        private void on_size_allocate (Gtk.Allocation allocation) {
                // If the window's width is less than half the width of a 1920×1080


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