[gtk+/wip/baedert/drawing: 296/301] inspector: Allow picking children of GtkWidget classes



commit d30f09542d33116ab721f364c21a535a12654b18
Author: Timm Bäder <mail baedert org>
Date:   Wed May 24 16:21:45 2017 +0200

    inspector: Allow picking children of GtkWidget classes

 gtk/inspector/inspect-button.c |   36 ++++++++++++++++--------------------
 1 files changed, 16 insertions(+), 20 deletions(-)
---
diff --git a/gtk/inspector/inspect-button.c b/gtk/inspector/inspect-button.c
index 1b97dc5..7109d83 100644
--- a/gtk/inspector/inspect-button.c
+++ b/gtk/inspector/inspect-button.c
@@ -110,29 +110,25 @@ find_widget (GtkWidget      *widget,
       (data->x < new_allocation.x + new_allocation.width) &&
       (data->y < new_allocation.y + new_allocation.height))
     {
+      FindWidgetData new_data = *data;
       /* First, check if the drag is in a valid drop site in
        * one of our children 
        */
-      if (GTK_IS_CONTAINER (widget))
-        {
-          FindWidgetData new_data = *data;
-
-          new_data.x -= x_offset;
-          new_data.y -= y_offset;
-          new_data.found = FALSE;
-          new_data.first = FALSE;
-
-          for (child = gtk_widget_get_first_child (widget);
-               child != NULL;
-               child = gtk_widget_get_next_sibling (child))
-             {
-                find_widget (child, &new_data);
-             }
-
-          data->found = new_data.found;
-          if (data->found)
-            data->res_widget = new_data.res_widget;
-        }
+      new_data.x -= x_offset;
+      new_data.y -= y_offset;
+      new_data.found = FALSE;
+      new_data.first = FALSE;
+
+      for (child = gtk_widget_get_first_child (widget);
+           child != NULL;
+           child = gtk_widget_get_next_sibling (child))
+         {
+            find_widget (child, &new_data);
+         }
+
+      data->found = new_data.found;
+      if (data->found)
+        data->res_widget = new_data.res_widget;
 
       /* If not, and this widget is registered as a drop site, check to
        * emit "drag_motion" to check if we are actually in


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