[gnome-shell/wip/paging-release: 78/85] all views are again alphabetical views



commit 0cd74409fa66d1326ca38dcdc3416f1d957c83d9
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 |   62 ++++++++++++--------------------------------------
 1 files changed, 15 insertions(+), 47 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index edc53d6..81f964d 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -70,13 +70,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;
@@ -132,7 +133,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 = [];
@@ -1111,13 +1113,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;
@@ -1172,44 +1177,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;
-        //FIXME
-      //let itemIcon2 = this._createItemIcon(item);
-      //this._allItems.push(item);
-        //this._items[id + 1] = itemIcon2;
-        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;
-            //FIXME
-            //this._grid.addItem(this._items[id + 1].actor);
-            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]