[gnome-shell/gbsneto/custom-icon-positions: 12/17] appDisplay: Create app folder where the drop happened
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/custom-icon-positions: 12/17] appDisplay: Create app folder where the drop happened
- Date: Wed, 24 Jun 2020 14:35:47 +0000 (UTC)
commit 75133e325e7834ddfd3265f069363889f1841f76
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
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.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
js/ui/appDisplay.js | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 79b8f6d8f6..463c51e4af 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1116,6 +1116,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)
@@ -1126,7 +1129,12 @@ 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);
+ this._savePages();
return true;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]