[gtk+] inspector: Make the action editor more useful



commit bd7e7d1dd60aa2351d62bb096cd0db423aa9256f
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jul 30 23:46:13 2014 +0200

    inspector: Make the action editor more useful
    
    We were not finding the action owner for menuitems, we have to
    try harder to walk all the way up to the window.

 gtk/inspector/prop-editor.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c
index 2e78da9..3b19e81 100644
--- a/gtk/inspector/prop-editor.c
+++ b/gtk/inspector/prop-editor.c
@@ -1253,22 +1253,20 @@ find_action_owner (GtkActionable *actionable)
   if (g_strcmp0 (prefix, "win") == 0)
     {
       if (G_IS_OBJECT (win))
-      return (GObject *)win;
+        return (GObject *)win;
     }
   else if (g_strcmp0 (prefix, "app") == 0)
     {  
       if (GTK_IS_WINDOW (win))
         return (GObject *)gtk_window_get_application (GTK_WINDOW (win));
     }
-  else
+
+  while (widget != NULL)
     {
-      while (widget != NULL)
-        {
-          group = _gtk_widget_get_action_group (widget, prefix);
-          if (group && g_action_group_has_action (group, name))
-            return (GObject *)widget;
-          widget = action_ancestor (widget);
-        }
+      group = _gtk_widget_get_action_group (widget, prefix);
+      if (group && g_action_group_has_action (group, name))
+        return (GObject *)widget;
+      widget = action_ancestor (widget);
     }
 
   return NULL;  


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