[appDisplay] Fix crash when app well is empty
When the app well doesn't contain any applications, it displays a placeholder text to indicate that it's a drop target. When porting WellGrid from St.Bin to St.BoxLayout, the call to set_child() to set the text was overlooked. https://bugzilla.gnome.org/show_bug.cgi?id=617281
This commit is contained in:
parent
6ca2fd03bd
commit
b83d5975b0
@ -1040,6 +1040,7 @@ function AppWell() {
|
||||
|
||||
AppWell.prototype = {
|
||||
_init : function() {
|
||||
this._placeholderText = null;
|
||||
this._menus = [];
|
||||
this._menuDisplays = [];
|
||||
|
||||
@ -1096,10 +1097,14 @@ AppWell.prototype = {
|
||||
let display = new AppWellIcon(app);
|
||||
this._grid.addItem(display.actor);
|
||||
}
|
||||
if (this._placeholderText) {
|
||||
this._placeholderText.destroy();
|
||||
this._placeholderText = null;
|
||||
}
|
||||
|
||||
if (running.length == 0 && nFavorites == 0) {
|
||||
let text = new St.Label({ text: _("Drag here to add favorites")});
|
||||
this._grid.actor.set_child(text);
|
||||
this._placeholderText = new St.Label({ text: _("Drag here to add favorites") });
|
||||
this.actor.add_actor(this._placeholderText);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user