[gnome-shell/gbsneto/icon-grid-dnd: 11/43] frequentView: Use BaseAppView.addItem() and loadGrid()
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/icon-grid-dnd: 11/43] frequentView: Use BaseAppView.addItem() and loadGrid()
- Date: Fri, 2 Aug 2019 19:34:05 +0000 (UTC)
commit ce78e8ae54043e4d7af7c464c66dc071ef6298e1
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Jun 29 13:15:20 2019 -0300
frequentView: Use BaseAppView.addItem() and loadGrid()
FrequentView is another view that is slightly not unified with how
BaseAppView expects subclasses to load app icons. Instead of using
BaseAppView.addItem() and then calling BaseAppview.loadGrid(), it
adds the app icons directly to the icon grid.
Make FrequentView add icons using BaseAppview.addItem(), and load
the icons using BaseAppView.loadGrid().
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645
js/ui/appDisplay.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 0cc3d9faa..714f6d148 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -706,6 +706,11 @@ var FrequentView = class FrequentView extends BaseAppView {
return this._usage.get_most_used().length >= MIN_FREQUENT_APPS_COUNT;
}
+ _compareItems() {
+ // The FrequentView does not need to be sorted alphabetically
+ return 0;
+ }
+
_loadApps() {
let mostUsed = this._usage.get_most_used();
let hasUsefulData = this.hasUsefulData();
@@ -726,8 +731,10 @@ var FrequentView = class FrequentView extends BaseAppView {
continue;
let appIcon = new AppIcon(mostUsed[i],
{ isDraggable: favoritesWritable });
- this._grid.addItem(appIcon, -1);
+ this.addItem(appIcon);
}
+
+ this.loadGrid();
}
// Called before allocation to calculate dynamic spacing
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]