[gnome-shell/gbsneto/icon-grid-dnd: 2/13] allView: Only create folder icon if it doesn't exist



commit 46e24dcfd30e0f2899a84ba5889f44e0856c2a46
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/603

 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 4a5c4796d..1e5094613 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -405,9 +405,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]