From c1f51a7bf34a97fe344ca9d6f48b5ca8be18d15a Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Tue, 8 May 2012 22:03:17 +0200 Subject: [PATCH] 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 deletion(-) diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index ef71bc7a0..792932868 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 fb1ca73e0..9ca5198f9 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);