[gnome-shell/wip/paging-release: 31/39] all views are again alphabetical views



commit 83cb53900d2efca9fbf5106bcb3ec4f7dcacd412
Author: Carlos Soriano <carlos soriano89 gmail com>
Date:   Fri Aug 2 13:19:43 2013 +0200

    all views are again alphabetical views

 js/ui/appDisplay.js |   54 ++++++++++++++------------------------------------
 1 files changed, 15 insertions(+), 39 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 952e2b4..971bdd3 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -69,13 +69,14 @@ const AlphabeticalView = new Lang.Class({
     Name: 'AlphabeticalView',
     Abstract: true,
 
-    _init: function() {
-        this._grid = new IconGrid.IconGrid({ xAlign: St.Align.MIDDLE,
-                                             usePagination: true,
-                                             columnLimit: MAX_COLUMNS,
-                                             minRows: MIN_ROWS,
-                                             minColumns: MIN_COLUMNS,
-                                             useSurroundingSpacing: true});
+    _init: function(gridParams) {
+        gridParams = Params.parse(gridParams,  {xAlign: St.Align.MIDDLE,
+                                                columnLimit: MAX_COLUMNS,
+                                                minRows: MIN_ROWS,
+                                                minColumns: MIN_COLUMNS,
+                                                usePagination: false,
+                                                useSurroundingSpacing: false});
+        this._grid = new IconGrid.IconGrid(gridParams);
 
         // Standard hack for ClutterBinLayout
         this._grid.actor.x_expand = true;
@@ -131,7 +132,8 @@ const AppPages = new Lang.Class({
     Extends: AlphabeticalView,
    
     _init: function(parent) {
-        this.parent();
+        this.parent({ usePagination: true,
+                      useSurroundingSpacing: true });
         this.actor = this._grid.actor;
         this._parent = parent;
         this._folderIcons = [];
@@ -1112,13 +1114,16 @@ const AppSearchProvider = new Lang.Class({
 
 const FolderView = new Lang.Class({
     Name: 'FolderView',
+    Extends: AlphabeticalView,
 
     _init: function() {
-        this._grid = new IconGrid.IconGrid({ xAlign: St.Align.MIDDLE,
+        this.parent({ useSurroundingSpacing: true });
+
+        /*this._grid = new IconGrid.IconGrid({ xAlign: St.Align.MIDDLE,
                                              columnLimit: MAX_COLUMNS,
                                              minRows: MIN_ROWS,
                                              minColumns: MIN_COLUMNS,
-                                             useSurroundingSpacing: true});
+                                             useSurroundingSpacing: true});*/
         // If it not expand, the parent doesn't take into account its preferred_width when allocating
         // the second time it allocates, so we apply the "Standard hack for ClutterBinLayout"
         this._grid.actor.x_expand = true;
@@ -1170,36 +1175,7 @@ const FolderView = new Lang.Class({
 
         return icon;
     },
-    
-    removeAll: function() {
-        this._grid.removeAll();
-        this._items = {};
-        this._allItems = [];
-    },
-
-    _addItem: function(item) {
-        let id = this._getItemId(item);
-        if (this._items[id] !== undefined)
-            return null;
-
-        let itemIcon = this._createItemIcon(item);
-        this._allItems.push(item);
-        this._items[id] = itemIcon;
-
-        return itemIcon;
-    },
 
-    loadGrid: function() {
-        this._allItems.sort(this._compareItems);
-
-        for (let i = 0; i < this._allItems.length; i++) {
-            let id = this._getItemId(this._allItems[i]);
-            if (!id)
-                continue;
-            this._grid.addItem(this._items[id]);
-        }
-    },
-    
     onUpdatedDisplaySize: function(width, height) {
         this._appDisplayWidth = width;
         this._appDisplayHeight = height;


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