[gtk+] range: Remove gadget completely



commit 9e796847625d1ef2503dbb9731feb44483b821cc
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 b59171a..1f7ab2b 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -90,7 +90,6 @@ struct _GtkRangePrivate
   /* Steppers are: < > ---- < >
    *               a b      c d
    */
-  GtkCssGadget *gadget;
   GtkCssGadget *contents_gadget;
   GtkCssGadget *stepper_a_gadget;
   GtkCssGadget *stepper_b_gadget;
@@ -632,15 +631,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,
@@ -1551,7 +1547,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);
@@ -3099,8 +3094,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]