[gnome-shell/gbsneto/icon-grid-dnd: 12/13] baseAppView: Call loadGrid() directly
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/icon-grid-dnd: 12/13] baseAppView: Call loadGrid() directly
- Date: Sat, 29 Jun 2019 17:17:12 +0000 (UTC)
commit 94d3621a6d8f2a6f6518b0a7dc92ec294c6f4c8f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Jun 29 13:22:08 2019 -0300
baseAppView: Call loadGrid() directly
Now that the three views follow the exact same loading routine
(remove all + load apps + load grid), we don't need each view
call loadGrid() directly anymore.
This is an important step in order to animate adding and removing
icons, since now we can diff old and new app icons properly.
Move all calls to BaseAppView.loadGrid() to a single one after
BaseAppView._loadApps(). Also add the underscore prefix, since
this is now considered a protected function.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/603
js/ui/appDisplay.js | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index ef8884aab..695ee857a 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -137,6 +137,7 @@ class BaseAppView {
_redisplay() {
this.removeAll();
this._loadApps();
+ this._loadGrid();
}
getAllItems() {
@@ -156,7 +157,7 @@ class BaseAppView {
return a.name.localeCompare(b.name);
}
- loadGrid() {
+ _loadGrid() {
this._allItems.sort(this._compareItems);
this._allItems.forEach(item => { this._grid.addItem(item); });
this.emit('view-loaded');
@@ -415,8 +416,10 @@ var AllView = class AllView extends BaseAppView {
{ isDraggable: favoritesWritable });
this.addItem(icon);
});
+ }
- this.loadGrid();
+ _loadGrid() {
+ super._loadGrid();
this._refilterApps();
}
@@ -801,8 +804,6 @@ var FrequentView = class FrequentView extends BaseAppView {
{ isDraggable: favoritesWritable });
this.addItem(appIcon);
}
-
- this.loadGrid();
}
// Called before allocation to calculate dynamic spacing
@@ -1248,8 +1249,6 @@ var FolderView = class FolderView extends BaseAppView {
addAppId(appInfo.get_id());
});
-
- this.loadGrid();
}
get folderIcon() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]