[gnome-shell/gbsneto/custom-icon-positions: 70/72] appDisplay: Move folder icons to where they're dropped



commit ce24705de6d21b873a7c35de7a01a71168c2ec6d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed May 27 14:39:54 2020 -0300

    appDisplay: Move folder icons to where they're dropped
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284

 js/ui/appDisplay.js | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index cf0923cd25..9d7f3129ec 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1126,10 +1126,19 @@ class AppDisplay extends BaseAppView {
             targetPosition++;
 
         let view = _getViewFromIcon(source);
-        if (view === this)
-            this.moveItem(source, targetPage, targetPosition);
-        else
+        let movedItem = source;
+
+        // Remove from the folder
+        if (view !== this) {
+            const id = source.id;
+
             view.removeApp(source.app);
+            this._redisplay();
+
+            movedItem = this._items.get(id);
+        }
+
+        this.moveItem(movedItem, targetPage, targetPosition);
 
         if (this._currentDialog)
             this._currentDialog.popdown();


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