[gnome-shell/gbsneto/custom-icon-positions: 15/28] appDisplay: Don't resort folders when name changes
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/custom-icon-positions: 15/28] appDisplay: Don't resort folders when name changes
- Date: Wed, 15 Jul 2020 20:51:06 +0000 (UTC)
commit dca5d10cffdd82f25967e7caddb6644e28d7c6d1
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue May 26 18:55:18 2020 -0300
appDisplay: Don't resort folders when name changes
With a customizable app grid, we don't want folders to move
after renaming. Their position is fixed.
Remove the sort-after-rename code from AppDisplay.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
js/ui/appDisplay.js | 21 ---------------------
1 file changed, 21 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 5ff8b517a2..666747ebcd 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -16,7 +16,6 @@ const PopupMenu = imports.ui.popupMenu;
const Search = imports.ui.search;
const SwipeTracker = imports.ui.swipeTracker;
const Params = imports.misc.params;
-const Util = imports.misc.util;
const SystemActions = imports.misc.systemActions;
var MENU_POPUP_TIMEOUT = 600;
@@ -719,23 +718,6 @@ class AppDisplay extends BaseAppView {
this._pageManager.pages = pages;
}
- _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._orderedItems.indexOf(item);
- this._orderedItems.splice(oldIdx, 1);
- let newIdx = Util.insertSorted(this._orderedItems, item, this._compareItems.bind(this));
-
- this._grid.removeItem(item);
-
- const { itemsPerPage } = this._grid;
- const page = Math.floor(newIdx / itemsPerPage);
- const position = newIdx % itemsPerPage;
- this._grid.addItem(item, page, position);
-
- this.selectApp(item.id);
- }
-
getAppInfos() {
return this._appInfoList;
}
@@ -785,7 +767,6 @@ class AppDisplay extends BaseAppView {
let icon = this._items.get(id);
if (!icon) {
icon = new FolderIcon(id, path, this);
- icon.connect('name-changed', this._itemNameChanged.bind(this));
icon.connect('apps-changed', this._redisplay.bind(this));
}
@@ -1601,7 +1582,6 @@ class FolderView extends BaseAppView {
var FolderIcon = GObject.registerClass({
Signals: {
'apps-changed': {},
- 'name-changed': {},
},
}, class FolderIcon extends AppViewItem {
_init(id, path, parentView) {
@@ -1735,7 +1715,6 @@ var FolderIcon = GObject.registerClass({
this._name = name;
this.icon.label.text = this.name;
- this.emit('name-changed');
}
_sync() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]