[gnome-shell/gbsneto/icon-grid-part1: 9/13] baseAppView: Move _loadGrid() into _redisplay()



commit 036e41621d8c840fb99e29dd736a48883523b93a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Jul 1 23:01:59 2019 -0300

    baseAppView: Move _loadGrid() into _redisplay()
    
    Next commit will introduce differential loading of
    app icons, and will reorganize this part of the
    codebase.
    
    When doing that, the ideal symmetry of the new code
    would be:
    
     * Update BaseAppView._allItems array
     * Update BaseAppView._items map
     * Update BaseAppView._grid actor
    
    Move the code in _loadGrid() into _redisplay() so that
    we can check in-place which new icons need to be added.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

 js/ui/appDisplay.js | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index c235f87f8..b253fdb21 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -123,7 +123,10 @@ class BaseAppView {
     _redisplay() {
         this.removeAll();
         this._loadApps();
-        this._loadGrid();
+
+        this._allItems.sort(this._compareItems);
+        this._allItems.forEach(item => this._grid.addItem(item));
+        this.emit('view-loaded');
     }
 
     getAllItems() {
@@ -147,12 +150,6 @@ class BaseAppView {
         return a.name.localeCompare(b.name);
     }
 
-    _loadGrid() {
-        this._allItems.sort(this._compareItems);
-        this._allItems.forEach(item => this._grid.addItem(item));
-        this.emit('view-loaded');
-    }
-
     _selectAppInternal(id) {
         if (this._items[id])
             this._items[id].actor.navigate_focus(null, St.DirectionType.TAB_FORWARD, false);
@@ -338,6 +335,7 @@ var AllView = class AllView extends BaseAppView {
             openFolderId = this._currentPopup._source.id;
 
         super._redisplay();
+        this._refilterApps();
 
         if (openFolderId) {
             let [folderToReopen] = this.folderIcons.filter(folder => folder.id == openFolderId);
@@ -420,11 +418,6 @@ var AllView = class AllView extends BaseAppView {
         });
     }
 
-    _loadGrid() {
-        super._loadGrid();
-        this._refilterApps();
-    }
-
     // Overridden from BaseAppView
     animate(animationDirection, onComplete) {
         this._scrollView.reactive = false;


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