[gnome-shell/gbsneto/icon-grid-part1: 1/5] baseAppView: Move _loadGrid() into _redisplay()
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/icon-grid-part1: 1/5] baseAppView: Move _loadGrid() into _redisplay()
- Date: Mon, 5 Aug 2019 22:52:58 +0000 (UTC)
commit b30a95a1fa9c470fcd2273560f96bdce1a5d49e6
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Jul 1 23:01:59 2019 -0300
baseAppView: Move _loadGrid() into _redisplay()
Next commit will introduce differential loading of
app icons, and will reorganize this part of the
codebase.
When doing that, the ideal symmetry of the new code
would be:
* Update BaseAppView._allItems array
* Update BaseAppView._items map
* Update BaseAppView._grid actor
Move the code in _loadGrid() into _redisplay() so that
we can check in-place which new icons need to be added.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645
js/ui/appDisplay.js | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 6bdd2ee51..ee65926f4 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -123,7 +123,10 @@ class BaseAppView {
_redisplay() {
this.removeAll();
this._loadApps();
- this._loadGrid();
+
+ this._allItems.sort(this._compareItems);
+ this._allItems.forEach(item => this._grid.addItem(item));
+ this.emit('view-loaded');
}
getAllItems() {
@@ -147,12 +150,6 @@ class BaseAppView {
return a.name.localeCompare(b.name);
}
- _loadGrid() {
- this._allItems.sort(this._compareItems);
- this._allItems.forEach(item => this._grid.addItem(item));
- this.emit('view-loaded');
- }
-
_selectAppInternal(id) {
if (this._items[id])
this._items[id].actor.navigate_focus(null, St.DirectionType.TAB_FORWARD, false);
@@ -338,6 +335,7 @@ var AllView = class AllView extends BaseAppView {
openFolderId = this._currentPopup._source.id;
super._redisplay();
+ this._refilterApps();
if (openFolderId) {
let [folderToReopen] = this.folderIcons.filter(folder => folder.id == openFolderId);
@@ -420,11 +418,6 @@ var AllView = class AllView extends BaseAppView {
});
}
- _loadGrid() {
- super._loadGrid();
- this._refilterApps();
- }
-
// Overridden from BaseAppView
animate(animationDirection, onComplete) {
this._scrollView.reactive = false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]