iconGrid: Use class handlers for ::child-{added,removed}
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3014>
This commit is contained in:
parent
0204920d8c
commit
d013555392
@ -1192,12 +1192,10 @@ export const IconGrid = GObject.registerClass({
|
|||||||
this._currentPage = 0;
|
this._currentPage = 0;
|
||||||
this._currentMode = -1;
|
this._currentMode = -1;
|
||||||
|
|
||||||
this.connect('child-added', this._childAdded.bind(this));
|
|
||||||
this.connect('child-removed', this._childRemoved.bind(this));
|
|
||||||
this.connect('destroy', () => layoutManager.disconnect(pagesChangedId));
|
this.connect('destroy', () => layoutManager.disconnect(pagesChangedId));
|
||||||
}
|
}
|
||||||
|
|
||||||
_childAdded(grid, child) {
|
vfunc_child_added(child) {
|
||||||
child._iconGridKeyFocusInId = child.connect('key-focus-in', () => {
|
child._iconGridKeyFocusInId = child.connect('key-focus-in', () => {
|
||||||
this._ensureItemIsVisible(child);
|
this._ensureItemIsVisible(child);
|
||||||
});
|
});
|
||||||
@ -1247,7 +1245,7 @@ export const IconGrid = GObject.registerClass({
|
|||||||
this._setGridMode(bestMode);
|
this._setGridMode(bestMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
_childRemoved(grid, child) {
|
vfunc_child_removed(child) {
|
||||||
child.disconnect(child._iconGridKeyFocusInId);
|
child.disconnect(child._iconGridKeyFocusInId);
|
||||||
delete child._iconGridKeyFocusInId;
|
delete child._iconGridKeyFocusInId;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user