[gtk+] volumebutton: Update adjustment usage for sealing



commit e62b39c921c31d1e4225951051b8dbb67bc1f291
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jan 5 23:03:09 2011 +0100

    volumebutton: Update adjustment usage for sealing
    
    Also rename all variables named "adj" to "adjustment", like they're
    called everywhere else.

 gtk/gtkvolumebutton.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkvolumebutton.c b/gtk/gtkvolumebutton.c
index 3a196c6..0415206 100644
--- a/gtk/gtkvolumebutton.c
+++ b/gtk/gtkvolumebutton.c
@@ -232,21 +232,21 @@ cb_query_tooltip (GtkWidget  *button,
 		  gpointer    user_data)
 {
   GtkScaleButton *scale_button = GTK_SCALE_BUTTON (button);
-  GtkAdjustment *adj;
+  GtkAdjustment *adjustment;
   gdouble val;
   char *str;
   AtkImage *image;
 
   image = ATK_IMAGE (gtk_widget_get_accessible (button));
 
-  adj = gtk_scale_button_get_adjustment (scale_button);
+  adjustment = gtk_scale_button_get_adjustment (scale_button);
   val = gtk_scale_button_get_value (scale_button);
 
-  if (val < (adj->lower + EPSILON))
+  if (val < (gtk_adjustment_get_lower (adjustment) + EPSILON))
     {
       str = g_strdup (_("Muted"));
     }
-  else if (val >= (adj->upper - EPSILON))
+  else if (val >= (gtk_adjustment_get_upper (adjustment) - EPSILON))
     {
       str = g_strdup (_("Full Volume"));
     }
@@ -254,7 +254,7 @@ cb_query_tooltip (GtkWidget  *button,
     {
       int percent;
 
-      percent = (int) (100. * val / (adj->upper - adj->lower) + .5);
+      percent = (int) (100. * val / (gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment)) + .5);
 
       /* Translators: this is the percentage of the current volume,
        * as used in the tooltip, eg. "49 %".



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]