Skip to content

Commit

Permalink
Sound applet: fix missing muted icon (#7402)
Browse files Browse the repository at this point in the history
"microphone-sensitivity-none" does not exist in Adwaita,
it's "microphone-sensitivity-muted".
  • Loading branch information
germanfr authored and clefebvre committed Apr 19, 2018
1 parent 2f5a2d9 commit faaa6ca
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions files/usr/share/cinnamon/applets/sound@cinnamon.org/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ VolumeSlider.prototype = {

this.app_icon = app_icon;
if (this.app_icon == null) {
this.iconName = this.isMic ? "microphone-sensitivity-none" : "audio-volume-muted";
this.iconName = this.isMic ? "microphone-sensitivity-muted" : "audio-volume-muted";
this.icon = new St.Icon({icon_name: this.iconName, icon_type: St.IconType.SYMBOLIC, icon_size: 16});
}
else {
Expand Down Expand Up @@ -193,16 +193,18 @@ VolumeSlider.prototype = {
},

_volumeToIcon: function(value){
if(value < 0.005)
return this.isMic? "microphone-sensitivity-none" : "audio-volume-muted";
let n = Math.floor(3 * value), icon;
if(n < 1)
icon = "low";
else if(n < 2)
icon = "medium";
else
icon = "high";

let icon;
if(value < 0.005) {
icon = "muted";
} else {
let n = Math.floor(3 * value);
if(n < 1)
icon = "low";
else if(n < 2)
icon = "medium";
else
icon = "high";
}
return this.isMic? "microphone-sensitivity-" + icon : "audio-volume-" + icon;
}
};
Expand Down Expand Up @@ -965,7 +967,7 @@ MyApplet.prototype = {
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));

this.mute_out_switch = new PopupMenu.PopupSwitchIconMenuItem(_("Mute output"), false, "audio-volume-muted", St.IconType.SYMBOLIC);
this.mute_in_switch = new PopupMenu.PopupSwitchIconMenuItem(_("Mute input"), false, "microphone-sensitivity-none", St.IconType.SYMBOLIC);
this.mute_in_switch = new PopupMenu.PopupSwitchIconMenuItem(_("Mute input"), false, "microphone-sensitivity-muted", St.IconType.SYMBOLIC);
this._applet_context_menu.addMenuItem(this.mute_out_switch);
this._applet_context_menu.addMenuItem(this.mute_in_switch);

Expand Down

0 comments on commit faaa6ca

Please sign in to comment.