appDisplay: Mostly remove adaptToSize
Back in the day, adaptToSize() contained mad maths to figure out icon sizes. Over time, its scope was reduced, to the point where we are today where it mostly just redoes some quick maths to predict the grid size based on the CSS box model. Remove adaptToSize() from BaseAppView and child classes. It still is an internal detail of the IconGrid class, but it's not exposed as a "public" method anymore. This removal is not perfect, as it doesn't move or compensate for any of page indicators and arrows code. This will be done in follow up commits introducing a new layout manager for that. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2335>
This commit is contained in:

committed by
Marge Bot

parent
5ba699e095
commit
083a691a74
@ -1207,6 +1207,11 @@ var IconGrid = GObject.registerClass({
|
||||
delete child._iconGridKeyFocusInId;
|
||||
}
|
||||
|
||||
vfunc_allocate(box) {
|
||||
this.layout_manager.adaptToSize(...box.get_size());
|
||||
super.vfunc_allocate(box);
|
||||
}
|
||||
|
||||
vfunc_style_changed() {
|
||||
super.vfunc_style_changed();
|
||||
|
||||
@ -1391,10 +1396,6 @@ var IconGrid = GObject.registerClass({
|
||||
return this.layout_manager.nPages;
|
||||
}
|
||||
|
||||
adaptToSize(width, height) {
|
||||
this.layout_manager.adaptToSize(width, height);
|
||||
}
|
||||
|
||||
setGridModes(modes) {
|
||||
this._gridModes = modes ? modes : defaultGridModes;
|
||||
this.queue_relayout();
|
||||
|
Reference in New Issue
Block a user