[gnome-shell/gbsneto/custom-icon-positions: 28/36] appDisplay: Ensure icons always are at the correct position
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/custom-icon-positions: 28/36] appDisplay: Ensure icons always are at the correct position
- Date: Mon, 13 Jul 2020 18:25:44 +0000 (UTC)
commit df5a6ea538e6d09d6eafea0943e50c7a951d164d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Jun 23 12:18:56 2020 -0300
appDisplay: Ensure icons always are at the correct position
When redisplaying, we currently only remove and add icons, but
never adjust the position of already added icons. If the icon
position changed, it wouldn't be reflected on the icon grid.
Make sure to move already added icons.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
js/ui/appDisplay.js | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 96fc656775..f031d68968 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -333,10 +333,13 @@ var BaseAppView = GObject.registerClass({
icon.destroy();
});
- // Add new app icons
- addedApps.forEach(icon => {
- const [page, position] = this._getItemPosition(icon, newApps);
- this._addItem(icon, page, position);
+ // Add new app icons, or move existing ones
+ newApps.forEach(icon => {
+ const [page, position] = this._getItemPosition(icon);
+ if (addedApps.includes(icon))
+ this._addItem(icon, page, position);
+ else if (page !== -1 && position !== -1)
+ this.moveItem(icon, page, position);
});
this._viewIsReady = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]