[gnome-shell/gbsneto/custom-icon-positions: 12/29] appDisplay: Save pages after dropping
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/custom-icon-positions: 12/29] appDisplay: Save pages after dropping
- Date: Fri, 10 Jul 2020 14:52:04 +0000 (UTC)
commit 09b9178267c379b32d0e2c70ec072e609c528163
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue May 26 01:41:17 2020 -0300
appDisplay: Save pages after dropping
Save the icon grid layout after dropping, and only in
that moment.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
js/ui/appDisplay.js | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 4e549a020d..5594ff5e7f 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -695,6 +695,25 @@ class AppDisplay extends BaseAppView {
super._redisplay();
}
+ _savePages() {
+ const pages = [];
+
+ for (let i = 0; i < this._grid.nPages; i++) {
+ const pageItems =
+ this._grid.getItemsAtPage(i).filter(c => c.visible);
+ const pageData = {};
+
+ pageItems.forEach((item, index) => {
+ pageData[item.id] = {
+ position: GLib.Variant.new_int32(index),
+ };
+ });
+ pages.push(pageData);
+ }
+
+ this._pageManager.pages = pages;
+ }
+
_itemNameChanged(item) {
// If an item's name changed, we can pluck it out of where it's
// supposed to be and reinsert it where it's sorted.
@@ -1070,6 +1089,8 @@ class AppDisplay extends BaseAppView {
this._removeDelayedMove();
}
+ this._savePages();
+
let view = _getViewFromIcon(source);
if (view instanceof FolderView)
view.removeApp(source.app);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]