summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Bruder <[email protected]>2017-04-28 10:07:00 +0200
committerMoritz Bruder <[email protected]>2017-04-28 13:21:30 +0200
commit63388f5e2832988e05ad5077a64f7cc153d02078 (patch)
tree52c05263e8657d211f24ccec7b4268c14cc15549
parentb005276f2bb281b1bc2d1ef4ba18cdd43294d58f (diff)
downloadmate-media-63388f5e2832988e05ad5077a64f7cc153d02078.tar.bz2
mate-media-63388f5e2832988e05ad5077a64f7cc153d02078.tar.xz
applet: round volume in popup of status icon
Most of the time the value was off almost 1 percent.
-rw-r--r--mate-volume-control/gvc-stream-status-icon.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mate-volume-control/gvc-stream-status-icon.c b/mate-volume-control/gvc-stream-status-icon.c
index 231b95d..2620c8b 100644
--- a/mate-volume-control/gvc-stream-status-icon.c
+++ b/mate-volume-control/gvc-stream-status-icon.c
@@ -421,25 +421,25 @@ update_icon (GvcStreamStatusIcon *icon)
_("Muted"),
description);
} else if (flags & MATE_MIXER_STREAM_CONTROL_VOLUME_READABLE) {
- gdouble display_volume = 100 * volume / normal;
+ guint display_volume = (guint) round (100.0 * volume / normal);
if (flags & MATE_MIXER_STREAM_CONTROL_HAS_DECIBEL) {
if (decibel > -MATE_MIXER_INFINITY) {
- markup = g_strdup_printf ("<b>%s: %.0f%%</b>\n"
+ markup = g_strdup_printf ("<b>%s: %u%%</b>\n"
"<small>%0.2f dB\n%s</small>",
icon->priv->display_name,
display_volume,
decibel,
description);
} else {
- markup = g_strdup_printf ("<b>%s: %.0f%%</b>\n"
+ markup = g_strdup_printf ("<b>%s: %u%%</b>\n"
"<small>-&#8734; dB\n%s</small>",
icon->priv->display_name,
display_volume,
description);
}
} else {
- markup = g_strdup_printf ("<b>%s: %.0f%%</b>\n<small>%s</small>",
+ markup = g_strdup_printf ("<b>%s: %u%%</b>\n<small>%s</small>",
icon->priv->display_name,
display_volume,
description);