summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-11-20 01:12:36 +0100
committerMichal Ratajsky <[email protected]>2014-11-20 01:12:36 +0100
commit0dfb20b64f6d6813cddec911057c6645cba1b842 (patch)
tree0ee4db01deffece876e94b4e6b697aa4e1027d4a
parent528c716f5712f771d2eb43704b2200f90186d3a0 (diff)
downloadmate-media-0dfb20b64f6d6813cddec911057c6645cba1b842.tar.bz2
mate-media-0dfb20b64f6d6813cddec911057c6645cba1b842.tar.xz
Only display 100% mark on sliders that actually go beyond 100%
-rw-r--r--mate-volume-control/gvc-channel-bar.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mate-volume-control/gvc-channel-bar.c b/mate-volume-control/gvc-channel-bar.c
index e431651..73ea43f 100644
--- a/mate-volume-control/gvc-channel-bar.c
+++ b/mate-volume-control/gvc-channel-bar.c
@@ -311,7 +311,9 @@ update_marks (GvcChannelBar *bar)
{
gdouble base;
gdouble normal;
+ gdouble max;
gboolean has_mark = FALSE;
+ gboolean extended;
gtk_scale_clear_marks (GTK_SCALE (bar->priv->scale));
@@ -322,6 +324,7 @@ update_marks (GvcChannelBar *bar)
* volume, in many cases they are the same as unamplified volume is unknown */
base = mate_mixer_stream_control_get_base_volume (bar->priv->control);
normal = mate_mixer_stream_control_get_normal_volume (bar->priv->control);
+ max = mate_mixer_stream_control_get_max_volume (bar->priv->control);
if (normal <= gtk_adjustment_get_lower (bar->priv->adjustment))
return;
@@ -339,7 +342,8 @@ update_marks (GvcChannelBar *bar)
/* Only show 100% mark if the scale is extended beyond 100% and
* there is no unamplified mark or it is below the normal volume */
- if (bar->priv->extended && (base == normal || base < normal)) {
+ extended = bar->priv->extended && max > normal;
+ if (extended && (base == normal || base < normal)) {
gchar *str = g_strdup_printf ("<small>%s</small>", C_("volume", "100%"));
gtk_scale_add_mark (GTK_SCALE (bar->priv->scale),