diff --git a/extension.js b/extension.js index 2598f2c..73b485f 100644 --- a/extension.js +++ b/extension.js @@ -388,7 +388,7 @@ class MonitorWidget extends PanelMenu.Button { let nestedItem = null; if (widgetDict.hasOwnProperty('text')) { nestedItem = widgetDict['text']; - widget = this._createText(nestedItem); + widget = this._createLabel(nestedItem); } else if (widgetDict.hasOwnProperty('picture')) { nestedItem = widgetDict['picture']; widget = this._createPicture(nestedItem); @@ -426,7 +426,7 @@ class MonitorWidget extends PanelMenu.Button { return this._createText(itemValues); } - _createText(item) { + __createText(item, isLabel) { if (!item.hasOwnProperty('text')) { log('Text must have a \'text\' value'); return null; @@ -439,13 +439,25 @@ class MonitorWidget extends PanelMenu.Button { if (item['text'] === '') { return null; } else { - const widget = new St.Button({ label: item['text'] }); + let widget = null; + if (isLabel) + widget = new St.Label({ text: item['text'] }); + else + widget = new St.Button({ label: item['text'] }); widget.set_style(style); return widget; } } + _createText(item) { + return this.__createText(item, false); + } + + _createLabel(item) { + return this.__createText(item, true); + } + _createIconOld(item) { var itemValues = {}; itemValues = { 'path':item['icon'] };