[gtk+/wip/baedert/drawing: 69/143] range: Remove gadget completely



commit 12f7b74fbcded6f44b1dbdcdbb4cb3d56e3ac705
Author: Timm Bäder <mail baedert org>
Date:   Fri May 5 20:34:17 2017 +0200

    range: Remove gadget completely

 gtk/gtkrange.c        |   15 ++++++---------
 gtk/gtkrangeprivate.h |    1 -
 2 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index c6fc149..34fa0af 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -92,7 +92,6 @@ struct _GtkRangePrivate
   /* Steppers are: < > ---- < >
    *               a b      c d
    */
-  GtkCssGadget *gadget;
   GtkCssGadget *contents_gadget;
   GtkCssGadget *stepper_a_gadget;
   GtkCssGadget *stepper_b_gadget;
@@ -640,15 +639,12 @@ gtk_range_init (GtkRange *range)
   _gtk_orientable_set_style_classes (GTK_ORIENTABLE (range));
 
   widget_node = gtk_widget_get_css_node (GTK_WIDGET (range));
-  priv->gadget = gtk_css_custom_gadget_new_for_node (widget_node,
-                                                     GTK_WIDGET (range),
-                                                     NULL,
-                                                     NULL,
-                                                     NULL,
-                                                     NULL, NULL);
   priv->contents_gadget = gtk_box_gadget_new ("contents",
                                               GTK_WIDGET (range),
-                                              priv->gadget, NULL);
+                                              NULL, NULL);
+  gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->contents_gadget),
+                           widget_node);
+
   priv->trough_gadget = gtk_css_custom_gadget_new ("trough",
                                                    GTK_WIDGET (range),
                                                    NULL, NULL,
@@ -1559,7 +1555,6 @@ gtk_range_finalize (GObject *object)
   g_clear_object (&priv->multipress_gesture);
   g_clear_object (&priv->long_press_gesture);
 
-  g_clear_object (&priv->gadget);
   g_clear_object (&priv->contents_gadget);
   g_clear_object (&priv->trough_gadget);
   g_clear_object (&priv->fill_gadget);
@@ -3168,8 +3163,10 @@ gtk_range_update_mouse_location (GtkRange *range)
     priv->mouse_location = priv->slider_gadget;
   else if (rectangle_contains_point (&slider_trace, x, y))
     priv->mouse_location = priv->trough_gadget;
+#if 0
   else if (gtk_css_gadget_margin_box_contains_point (priv->gadget, x, y))
     priv->mouse_location = priv->gadget;
+#endif
   else
     priv->mouse_location = NULL;
 
diff --git a/gtk/gtkrangeprivate.h b/gtk/gtkrangeprivate.h
index a3d35b3..e5e0c55 100644
--- a/gtk/gtkrangeprivate.h
+++ b/gtk/gtkrangeprivate.h
@@ -27,7 +27,6 @@
 
 
 #include <gtk/gtkrange.h>
-#include <gtk/gtkcssgadgetprivate.h>
 #include <gtk/gtkcssnodeprivate.h>
 
 


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