[gtk+/refactor: 108/110] gtkscalebutton: use accessor functions to access GtkRange



commit 028eba7dc87162301a15610243f5a6c1b293da87
Author: Javier Jardón <jjardon gnome org>
Date:   Fri Aug 13 01:43:27 2010 +0200

    gtkscalebutton: use accessor functions to access GtkRange

 gtk/gtkscalebutton.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c
index 151f10a..5905d91 100644
--- a/gtk/gtkscalebutton.c
+++ b/gtk/gtkscalebutton.c
@@ -901,6 +901,7 @@ gtk_scale_popup (GtkWidget *widget,
   GtkScaleButtonPrivate *priv;
   GtkAdjustment *adj;
   gint x, y, m, dx, dy, sx, sy, startoff;
+  gint min_slider_size;
   gdouble v;
   GdkDisplay *display;
   GdkScreen *screen;
@@ -948,6 +949,7 @@ gtk_scale_popup (GtkWidget *widget,
 
   /* position (needs widget to be shown already) */
   v = gtk_scale_button_get_value (button) / (adj->upper - adj->lower);
+  min_slider_size = gtk_range_get_min_slider_size (GTK_RANGE (priv->scale));
 
   if (priv->orientation == GTK_ORIENTATION_VERTICAL)
     {
@@ -955,8 +957,8 @@ gtk_scale_popup (GtkWidget *widget,
 
       x += (allocation.width - dock_allocation.width) / 2;
       y -= startoff;
-      y -= GTK_RANGE (priv->scale)->min_slider_size / 2;
-      m = scale_allocation.height - GTK_RANGE (priv->scale)->min_slider_size;
+      y -= min_slider_size / 2;
+      m = scale_allocation.height - min_slider_size;
       y -= m * (1.0 - v);
     }
   else
@@ -965,8 +967,8 @@ gtk_scale_popup (GtkWidget *widget,
 
       x -= startoff;
       y += (allocation.height - dock_allocation.height) / 2;
-      x -= GTK_RANGE (priv->scale)->min_slider_size / 2;
-      m = scale_allocation.width - GTK_RANGE (priv->scale)->min_slider_size;
+      x -= min_slider_size / 2;
+      m = scale_allocation.width - min_slider_size;
       x -= m * v;
     }
 
@@ -1081,16 +1083,14 @@ gtk_scale_popup (GtkWidget *widget,
       if (priv->orientation == GTK_ORIENTATION_VERTICAL)
         {
           e->x = scale_allocation.width / 2;
-          m = scale_allocation.height -
-              GTK_RANGE (priv->scale)->min_slider_size;
-          e->y = ((1.0 - v) * m) + GTK_RANGE (priv->scale)->min_slider_size / 2;
+          m = scale_allocation.height - min_slider_size;
+          e->y = ((1.0 - v) * m) + min_slider_size / 2;
         }
       else
         {
           e->y = scale_allocation.height / 2;
-          m = scale_allocation.width -
-              GTK_RANGE (priv->scale)->min_slider_size;
-          e->x = (v * m) + GTK_RANGE (priv->scale)->min_slider_size / 2;
+          m = scale_allocation.width - min_slider_size;
+          e->x = (v * m) + min_slider_size / 2;
         }
 
       gtk_widget_event (priv->scale, (GdkEvent *) e);



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