Skip to content

Commit

Permalink
Fix disappeared icons on the detailed panel
Browse files Browse the repository at this point in the history
Icons could not be added to the popup panel, because of two reasons:
- A bug in the extension caused icon to be undefined
- Gnome Shell rejects adding the same into as child actor to more than
one parent.

This commit fixes both issues.
  • Loading branch information
elvetemedve committed Sep 16, 2018
1 parent ed705ff commit 4c7aef0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions [email protected]/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ AbstractFactory.registerObject('meter-area-widget', MeterAreaWidgetFactory);

const MeterWidgetFactory = function() {};

MeterWidgetFactory.prototype.create = function(type, options, icon) {
MeterWidgetFactory.prototype.create = function(type, icon) {
let title, meter_widget;
if (type == PrefsKeys.CPU_METER) {
title = 'CPU';
Expand All @@ -190,7 +190,7 @@ MeterWidgetFactory.prototype.create = function(type, options, icon) {

meter_widget.addTitleItem(new Widget.ResourceTitleItem(title, icon, 'loading...'));
for (var i = 0; i < 3; i++) {
meter_widget.addMenuItem(AbstractFactory.create('meter-widget-item', type, options));
meter_widget.addMenuItem(AbstractFactory.create('meter-widget-item', type));
}
return meter_widget;
}
Expand All @@ -200,7 +200,7 @@ AbstractFactory.registerObject('meter-widget', MeterWidgetFactory);

const MeterWidgetItemFactory = function() {};

MeterWidgetItemFactory.prototype.create = function(type, options) {
MeterWidgetItemFactory.prototype.create = function(type) {
switch (type) {
case PrefsKeys.CPU_METER:
case PrefsKeys.MEMORY_METER:
Expand Down
2 changes: 1 addition & 1 deletion [email protected]/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ var Menu = new Lang.Class({
meter.addObserver(icon);
this._layout.insert_child_at_index(icon, this.available_meters.indexOf(type));
this._icons[type] = icon;
return icon;
return FactoryModule.AbstractFactory.create('icon', type, {}, can_show_activity);
},
_destroyIcon: function(type) {
let icon = this._icons[type];
Expand Down

0 comments on commit 4c7aef0

Please sign in to comment.