aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-02 16:05:07 +0200
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-02 16:05:07 +0200
commita12165624efe06093c1c7392c7ce294a4c4b8e63 (patch)
tree6b772375b8d6cfae1562d28e5d3361b16fe1250f
parent0e8f4f68f88e16d06c092d7677d552bf0f614206 (diff)
parent04179cf043ffe4aadbba4504e30a89f97ff86267 (diff)
downloadayatana-indicator-sound-a12165624efe06093c1c7392c7ce294a4c4b8e63.tar.gz
ayatana-indicator-sound-a12165624efe06093c1c7392c7ce294a4c4b8e63.tar.bz2
ayatana-indicator-sound-a12165624efe06093c1c7392c7ce294a4c4b8e63.zip
Merged lp:~xavi-garcia-mena/indicator-sound/icon-volume-zero
-rw-r--r--src/service.vala17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/service.vala b/src/service.vala
index f17d799..4857634 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -129,11 +129,12 @@ public class IndicatorSound.Service: Object {
}
private void show_notification(Notify.Notification? n) {
- return_if_fail (n != null);
- try {
- n.show ();
- } catch (GLib.Error e) {
- warning ("Unable to show notification: %s", e.message);
+ if (n != null) {
+ try {
+ n.show ();
+ } catch (GLib.Error e) {
+ warning ("Unable to show notification: %s", e.message);
+ }
}
}
@@ -239,12 +240,10 @@ public class IndicatorSound.Service: Object {
void update_root_icon () {
double volume = this.volume_control.volume.volume;
string icon;
- if (this.volume_control.mute)
+ if (this.volume_control.mute || volume <= 0.0)
icon = this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel";
else if (this.accounts_service != null && this.accounts_service.silentMode)
- icon = "audio-volume-muted-panel";
- else if (volume <= 0.0)
- icon = "audio-volume-low-zero-panel";
+ icon = "audio-volume-muted-panel";
else if (volume <= 0.3)
icon = "audio-volume-low-panel";
else if (volume <= 0.7)