[gnome-shell/gbsneto/custom-icon-positions: 2/2] appDisplay: Create app folder where the drop happened



commit 42d3378c7a73765b4da4bcc886948074282a7d2b
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue May 26 22:29:29 2020 -0300

    appDisplay: Create app folder where the drop happened
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
    Create the app folder where the icon we drop at is located. This
    ensures the folder icon doesn't go into the last page, hidden and
    solitary.

 js/ui/appDisplay.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 7ea5e9d76e..d2960c4ee3 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1159,6 +1159,9 @@ class AppDisplay extends BaseAppView {
             return false;
         }
 
+        const [folderPage, folderPosition] =
+            this._grid.getItemPosition(this._items.get(apps[0]));
+
         let appItems = apps.map(id => this._items.get(id).app);
         let folderName = _findBestFolderName(appItems);
         if (!folderName)
@@ -1169,7 +1172,11 @@ class AppDisplay extends BaseAppView {
         newFolderSettings.set_strv('apps', apps);
         newFolderSettings.apply();
 
-        this.selectApp(newFolderId);
+        this._redisplay();
+
+        // Move the folder to where the icon target icon was
+        const folderIcon = this._items.get(newFolderId);
+        this.moveItem(folderIcon, folderPage, folderPosition);
 
         return true;
     }


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