appDisplay: Move child focus handling to IconGrid
The icon grid is always paginated, so the app grid code doesn't need to behave differently in the FolderView and AppDisplay. Move the keyboard handling to IconGrid itself, and remove the now dead code from AppDisplay. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1271
This commit is contained in:
@@ -1143,7 +1143,6 @@ var IconGrid = GObject.registerClass({
|
||||
Signals: {
|
||||
'pages-changed': {},
|
||||
'animation-done': {},
|
||||
'child-focused': { param_types: [Clutter.Actor.$gtype] },
|
||||
},
|
||||
}, class IconGrid extends St.Viewport {
|
||||
_init(layoutParams = {}) {
|
||||
@@ -1199,7 +1198,9 @@ var IconGrid = GObject.registerClass({
|
||||
}
|
||||
|
||||
_childAdded(grid, child) {
|
||||
child._iconGridKeyFocusInId = child.connect('key-focus-in', actor => this.emit('child-focused', actor));
|
||||
child._iconGridKeyFocusInId = child.connect('key-focus-in', () => {
|
||||
this._ensureItemIsVisible(child);
|
||||
});
|
||||
|
||||
child._paintVisible = child.opacity > 0;
|
||||
child._opacityChangedId = child.connect('notify::opacity', () => {
|
||||
@@ -1210,6 +1211,14 @@ var IconGrid = GObject.registerClass({
|
||||
});
|
||||
}
|
||||
|
||||
_ensureItemIsVisible(item) {
|
||||
if (!this.contains(item))
|
||||
throw new Error(`${item} is not a child of IconGrid`);
|
||||
|
||||
const itemPage = this.layout_manager.getItemPage(item);
|
||||
this.goToPage(itemPage);
|
||||
}
|
||||
|
||||
_setGridMode(modeIndex) {
|
||||
if (this._currentMode === modeIndex)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user