aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-10-01 14:02:12 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-10-01 14:02:12 +0200
commit4600123677c7897e76eb8b666c2b3211ebcd19d4 (patch)
treed3609f4e42eabd0800f4c955117b539656b99f6c /src
parent91c06e1edbe3f7f25aaad1905733ae690e4fdf26 (diff)
downloadayatana-indicator-sound-4600123677c7897e76eb8b666c2b3211ebcd19d4.tar.gz
ayatana-indicator-sound-4600123677c7897e76eb8b666c2b3211ebcd19d4.tar.bz2
ayatana-indicator-sound-4600123677c7897e76eb8b666c2b3211ebcd19d4.zip
service: use vala's double.clamp()
Diffstat (limited to 'src')
-rw-r--r--src/service.vala7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/service.vala b/src/service.vala
index 9c7bcc9..9041097 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -82,12 +82,7 @@ public class IndicatorSound.Service {
int delta = param.get_int32(); /* positive for up, negative for down */
double v = this.volume_control.get_volume () + volume_step_percentage * delta;
- if (v > 1.0)
- v = 1.0;
- else if (v < 0.0)
- v = 0.0;
-
- this.volume_control.set_volume (v);
+ this.volume_control.set_volume (v.clamp (0.0, 1.0));
}
void activate_desktop_settings (SimpleAction action, Variant? param) {