iconGrid: Properly remove pages
When the last item of an IconGridLayout page is removed, the page itself is removed too. However, the indexes of items of next pages are not updated, which mess up the layout manager state. Update the page index of the items at forward pages when removing a page. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1406
This commit is contained in:
parent
beddbc0583
commit
f541562acc
@ -468,6 +468,12 @@ var IconGridLayout = GObject.registerClass({
|
||||
this._unlinkItem(item);
|
||||
});
|
||||
|
||||
// Adjust the page indexes of items after this page
|
||||
for (const itemData of this._items.values()) {
|
||||
if (itemData.pageIndex > pageIndex)
|
||||
itemData.pageIndex--;
|
||||
}
|
||||
|
||||
this._pages.splice(pageIndex, 1);
|
||||
this.emit('pages-changed');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user