[gnome-shell] searchDisplay: Use the rowLimit we pass to the IconGrid



commit c1f51a7bf34a97fe344ca9d6f48b5ca8be18d15a
Author: Christian Weber <c weber23 online de>
Date:   Tue May 8 22:03:17 2012 +0200

    searchDisplay: Use the rowLimit we pass to the IconGrid
    
    When displaying children, we need to make sure that we use the rowLimit
    property that we pass to iconGrid, rather than assuming that it's
    always MAX_SEARCH_RESULTS_ROWS in case some subclass (in an extension maybe)
    wants to do something different.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=675527

 js/ui/iconGrid.js      |    4 ++++
 js/ui/searchDisplay.js |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index ef71bc7..7929328 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -282,6 +282,10 @@ const IconGrid = new Lang.Class({
         return this._computeLayout(rowWidth)[0];
     },
 
+    getRowLimit: function() {
+        return this._rowLimit;
+    },
+
     _computeLayout: function (forWidth) {
         let nColumns = 0;
         let usedWidth = 0;
diff --git a/js/ui/searchDisplay.js b/js/ui/searchDisplay.js
index fb1ca73..9ca5198 100644
--- a/js/ui/searchDisplay.js
+++ b/js/ui/searchDisplay.js
@@ -131,7 +131,7 @@ const GridSearchResults = new Lang.Class({
 
     getResultsForDisplay: function() {
         let alreadyVisible = this._pendingClear ? 0 : this._grid.visibleItemsCount();
-        let canDisplay = this._grid.childrenInRow(this._width) * MAX_SEARCH_RESULTS_ROWS
+        let canDisplay = this._grid.childrenInRow(this._width) * this._grid.getRowLimit()
                          - alreadyVisible;
 
         let numResults = Math.min(this._notDisplayedResult.length, canDisplay);



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