iconGrid: Change IconGrid.addItem() to take an object instead of an actor
IconGrid has never really been a general purpose container, but has always been used in conjunction with BaseIcon. IconGrid will soon gain the ability to adjust the item size dynamically to adapt to the available space, which will require that we can make some more assumptions about the items added to the grid (namely: we need access to BaseIcon's setIconSize() method). So change addItem() to take an object instead, which should have an actor and a (BaseIcon) icon property. Based on a patch by Carlos Soriano. https://bugzilla.gnome.org/show_bug.cgi?id=706081
This commit is contained in:

committed by
Carlos Soriano

parent
9a8bf3b881
commit
792b963bda
@ -129,7 +129,7 @@ const BaseAppView = new Lang.Class({
|
||||
let id = this._getItemId(this._allItems[i]);
|
||||
if (!id)
|
||||
continue;
|
||||
this._grid.addItem(this._items[id].actor);
|
||||
this._grid.addItem(this._items[id]);
|
||||
}
|
||||
|
||||
this.emit('view-loaded');
|
||||
@ -583,7 +583,7 @@ const FrequentView = new Lang.Class({
|
||||
if (!mostUsed[i].get_app_info().should_show())
|
||||
continue;
|
||||
let appIcon = new AppIcon(mostUsed[i]);
|
||||
this._grid.addItem(appIcon.actor, -1);
|
||||
this._grid.addItem(appIcon, -1);
|
||||
}
|
||||
},
|
||||
|
||||
@ -862,10 +862,9 @@ const AppSearchProvider = new Lang.Class({
|
||||
app.open_new_window(workspace);
|
||||
},
|
||||
|
||||
createResultActor: function (resultMeta, terms) {
|
||||
createResultObject: function (resultMeta, terms) {
|
||||
let app = resultMeta['id'];
|
||||
let icon = new AppIcon(app);
|
||||
return icon.actor;
|
||||
return new AppIcon(app);
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user