allView: Don't sort icons
We are moving towards being able to move icons to custom positions. To achieve that, the icon grid should stop sort its icons. Remove the sorting code from AllView and BaseAppView. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/603
This commit is contained in:
parent
37aa5d0faf
commit
ca01b0287e
@ -151,13 +151,7 @@ class BaseAppView {
|
|||||||
return this._allItems;
|
return this._allItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
_compareItems(a, b) {
|
|
||||||
return a.name.localeCompare(b.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
_loadGrid() {
|
_loadGrid() {
|
||||||
this._allItems.sort(this._compareItems);
|
|
||||||
|
|
||||||
this._allItems.forEach((item, index) => {
|
this._allItems.forEach((item, index) => {
|
||||||
// Don't readd already added items
|
// Don't readd already added items
|
||||||
if (item.actor.get_parent())
|
if (item.actor.get_parent())
|
||||||
@ -349,17 +343,6 @@ var AllView = class AllView extends BaseAppView {
|
|||||||
this._nEventBlockerInhibits = 0;
|
this._nEventBlockerInhibits = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_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.
|
|
||||||
let oldIdx = this._allItems.indexOf(item);
|
|
||||||
this._allItems.splice(oldIdx, 1);
|
|
||||||
let newIdx = Util.insertSorted(this._allItems, item, this._compareItems);
|
|
||||||
|
|
||||||
this._grid.removeItem(item);
|
|
||||||
this._grid.addItem(item, newIdx);
|
|
||||||
}
|
|
||||||
|
|
||||||
_refilterApps() {
|
_refilterApps() {
|
||||||
let filteredApps = this._allItems.filter(icon => !icon.actor.visible);
|
let filteredApps = this._allItems.filter(icon => !icon.actor.visible);
|
||||||
|
|
||||||
@ -412,7 +395,6 @@ var AllView = class AllView extends BaseAppView {
|
|||||||
let icon = this._items[id];
|
let icon = this._items[id];
|
||||||
if (!icon) {
|
if (!icon) {
|
||||||
icon = new FolderIcon(id, path, this);
|
icon = new FolderIcon(id, path, this);
|
||||||
icon.connect('name-changed', this._itemNameChanged.bind(this));
|
|
||||||
icon.connect('apps-changed', this._redisplay.bind(this));
|
icon.connect('apps-changed', this._redisplay.bind(this));
|
||||||
}
|
}
|
||||||
newApps.push(icon);
|
newApps.push(icon);
|
||||||
@ -821,11 +803,6 @@ var FrequentView = class FrequentView extends BaseAppView {
|
|||||||
return this._usage.get_most_used().length >= MIN_FREQUENT_APPS_COUNT;
|
return this._usage.get_most_used().length >= MIN_FREQUENT_APPS_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
_compareItems() {
|
|
||||||
// The FrequentView does not need to be sorted alphabetically
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
_loadApps() {
|
_loadApps() {
|
||||||
let apps = [];
|
let apps = [];
|
||||||
let mostUsed = this._usage.get_most_used();
|
let mostUsed = this._usage.get_most_used();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user