diff options
author | Javier Jardón <jjardon@gnome.org> | 2010-08-13 01:43:27 +0200 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2010-08-23 20:47:45 +0200 |
commit | 27ec5cd55687f303f204cfa6607651f7ba52bd97 (patch) | |
tree | 3dc17d5960812397d9c20b5f5c7899e3fa101522 | |
parent | a64869db9ec3f3b35881c38c1df314dada4a07b0 (diff) | |
download | gtk+-27ec5cd55687f303f204cfa6607651f7ba52bd97.tar.gz |
gtkscalebutton: use accessor functions to access GtkRange
-rw-r--r-- | gtk/gtkscalebutton.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c index 151f10a214..5905d91ac0 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); |