[gtk+/wip/baedert/drawing: 14/142] scale: Fix value position



commit eb618241dd2995781cb3e9765f7e590180137fbc
Author: Timm Bäder <mail baedert org>
Date:   Fri May 5 18:07:19 2017 +0200

    scale: Fix value position
    
    by not using the range's gadget which is not allocated to any position
    anymore.

 gtk/gtkrange.c        |    6 ------
 gtk/gtkrangeprivate.h |    1 -
 gtk/gtkscale.c        |    5 ++---
 3 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 18fec60..b59171a 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -3654,9 +3654,3 @@ gtk_range_get_slider_gadget (GtkRange *range)
 {
   return range->priv->slider_gadget;
 }
-
-GtkCssGadget *
-gtk_range_get_gadget (GtkRange *range)
-{
-  return range->priv->gadget;
-}
diff --git a/gtk/gtkrangeprivate.h b/gtk/gtkrangeprivate.h
index 98456a6..a3d35b3 100644
--- a/gtk/gtkrangeprivate.h
+++ b/gtk/gtkrangeprivate.h
@@ -50,7 +50,6 @@ void               _gtk_range_set_steppers                 (GtkRange      *range
                                                             gboolean       has_d);
 
 GtkCssGadget      *gtk_range_get_slider_gadget             (GtkRange *range);
-GtkCssGadget      *gtk_range_get_gadget                    (GtkRange *range);
 
 G_END_DECLS
 
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index bde4a8b..3849eac 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -291,11 +291,10 @@ gtk_scale_allocate_value (GtkScale      *scale,
   GtkScalePrivate *priv = scale->priv;
   GtkWidget *widget = GTK_WIDGET (scale);
   GtkRange *range = GTK_RANGE (widget);
-  GtkCssGadget *range_gadget, *slider_gadget;
+  GtkCssGadget *slider_gadget;
   GtkAllocation range_alloc, slider_alloc, value_alloc;
 
-  range_gadget = gtk_range_get_gadget (range);
-  gtk_css_gadget_get_margin_allocation (range_gadget, &range_alloc, NULL);
+  gtk_widget_get_margin_allocation (widget, &range_alloc);
 
   slider_gadget = gtk_range_get_slider_gadget (range);
   gtk_css_gadget_get_border_allocation (slider_gadget, &slider_alloc, NULL);


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