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



commit 871a9105f5bae356203727cb9ae804be910ad4c0
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 dd65218b24..d7d3bb6747 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1130,10 +1130,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]