[gnome-shell/gbsneto/icon-grid-part1: 8/9] allView: Only create folder icon if it doesn't exist



commit 039e81a82877ce1bb725ef50a56ff632612f3945
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Jul 2 13:28:52 2019 -0300

    allView: Only create folder icon if it doesn't exist
    
    Avoid creating folder icons for folders that already exist. This is
    necessary to keep animations smooth.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

 js/ui/appDisplay.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 9ea76f470..b564772ec 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -390,9 +390,12 @@ var AllView = class AllView extends BaseAppView {
         let folders = this._folderSettings.get_strv('folder-children');
         folders.forEach(id => {
             let path = this._folderSettings.path + 'folders/' + id + '/';
-            let icon = new FolderIcon(id, path, this);
-            icon.connect('name-changed', this._itemNameChanged.bind(this));
-            icon.connect('apps-changed', this._refilterApps.bind(this));
+            let icon = this._items[id];
+            if (!icon) {
+                icon = new FolderIcon(id, path, this);
+                icon.connect('name-changed', this._itemNameChanged.bind(this));
+                icon.connect('apps-changed', this._refilterApps.bind(this));
+            }
             newApps.push(icon);
             this.folderIcons.push(icon);
         });


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