Skip to content

Commit

Permalink
Fixed power applet icon and added tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Clement Lefebvre committed Feb 19, 2012
1 parent c15300a commit 874ba94
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ MyApplet.prototype = {
if (error) {
this._hasPrimary = false;
this._primaryDeviceId = null;
this._batteryItem.actor.hide();
this._batteryItem.actor.hide();
return;
}
let [device_id, device_type, icon, percentage, state, seconds] = device;
Expand All @@ -213,6 +213,7 @@ MyApplet.prototype = {
} else
timestring = ngettext("%d minute remaining", "%d minutes remaining", minutes).format(minutes);
this._batteryItem.label.text = timestring;
this.set_applet_tooltip(timestring);
}
this._primaryPercentage.text = C_("percent of battery remaining", "%d%%").format(Math.round(percentage));
this._batteryItem.actor.show();
Expand Down Expand Up @@ -241,6 +242,7 @@ MyApplet.prototype = {
continue;

let item = new DeviceItem (devices[i]);
this.set_applet_tooltip(item._label.text);
this._deviceItems.push(item);
this.menu.addMenuItem(item, this._otherDevicePosition + position);
position++;
Expand All @@ -250,8 +252,9 @@ MyApplet.prototype = {

_devicesChanged: function() {
this._proxy.GetRemote('Icon', Lang.bind(this, function(icon, error) {
if (icon) {
this.set_applet_icon_symbolic_name(icon);
if (icon) {
let gicon = Gio.icon_new_for_string(icon);
this._applet_icon.gicon = gicon;
this.actor.show();
} else {
this.menu.close();
Expand Down

0 comments on commit 874ba94

Please sign in to comment.