Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cache icon names and tooltips, to avoid changing them unnecessarily.

  • Loading branch information...
commit a84d5fbea9775db261715996d4991baf774f3c44 1 parent c698084
@autarkper authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 js/ui/applet.js
View
10 js/ui/applet.js
@@ -169,8 +169,10 @@ Applet.prototype = {
},
set_applet_tooltip: function (text) {
- this._applet_tooltip_text = text;
- this._applet_tooltip.set_text(text);
+ if (this._applet_tooltip_text !== text) {
+ this._applet_tooltip.set_text(text);
+ this._applet_tooltip_text = text;
+ }
},
on_applet_clicked: function(event) {
@@ -281,6 +283,10 @@ IconApplet.prototype = {
},
set_applet_icon_symbolic_name: function (icon_name) {
+ if (this.__icon_name === icon_name) {
+ return;
+ }
+
if (this._scaleMode) {
let height = (this._panelHeight / DEFAULT_PANEL_HEIGHT) * PANEL_SYMBOLIC_ICON_DEFAULT_HEIGHT;
this._applet_icon = new St.Icon({icon_name: icon_name, icon_size: height, icon_type: St.IconType.SYMBOLIC, reactive: true, track_hover: true, style_class: 'system-status-icon' });
Please sign in to comment.
Something went wrong with that request. Please try again.