aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharles kerr <charlesk@canonical.com>2015-12-30 16:19:37 -0600
committercharles kerr <charlesk@canonical.com>2015-12-30 16:19:37 -0600
commit081627214d7ad7056934b6d152469f8ede079468 (patch)
tree004e8d473279c7baf2adfbaa92f3a5939c04e3c6
parent521915475eb73ae22e2c270c687f1f4d5c7c0465 (diff)
downloadayatana-indicator-sound-081627214d7ad7056934b6d152469f8ede079468.tar.gz
ayatana-indicator-sound-081627214d7ad7056934b6d152469f8ede079468.tar.bz2
ayatana-indicator-sound-081627214d7ad7056934b6d152469f8ede079468.zip
when showing volume % in notification, clamp to the range of [0%..100%]
-rw-r--r--src/info-notification.vala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/info-notification.vala b/src/info-notification.vala
index bf04f61..2aabcba 100644
--- a/src/info-notification.vala
+++ b/src/info-notification.vala
@@ -44,7 +44,7 @@ public class IndicatorSound.InfoNotification: Notification
n.set_hint ("x-canonical-non-shaped-icon", "true");
n.set_hint ("x-canonical-private-synchronous", "true");
n.set_hint ("x-canonical-value-bar-tint", is_high_volume ? "true" : "false");
- n.set_hint ("value", (int32)((volume * 100.0) + 0.5));
+ n.set_hint ("value", ((int32)((volume * 100.0) + 0.5)).clamp(0, 100));
show_notification();
}