[gtk+/wip/gtkmenutrackeritem] menushell: Rearrange and fix indentation



commit 5dda160d12da7b6aca7df92964f69cdc50b86c98
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri May 10 13:27:02 2013 -0400

    menushell: Rearrange and fix indentation

 gtk/gtkmenushell.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index bf7b7ba..a22ca71 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -2090,17 +2090,20 @@ gtk_menu_shell_tracker_insert_func (GtkMenuTrackerItem *item,
   GtkWidget *widget;
 
   if (gtk_menu_tracker_item_get_is_separator (item))
-    widget = gtk_separator_menu_item_new ();
-  else
-    widget = gtk_model_menu_item_new ();
-
-  /* TODO: drop this when we have bindings that ref the source */
-  g_object_set_data_full (G_OBJECT (widget), "GtkMenuTrackerItem", g_object_ref (item), g_object_unref);
+    {
+      widget = gtk_separator_menu_item_new ();
 
-  if (!GTK_IS_SEPARATOR_MENU_ITEM (widget))
+      /* For separators, we bind to the "label" property in case there
+       * is a section heading.
+       */
+      g_object_bind_property (item, "label", widget, "label", G_BINDING_SYNC_CREATE);
+    }
+  else
     {
       GMenuModel *submenu;
 
+      widget = gtk_model_menu_item_new ();
+
       /* We bind to "text" instead of "label" because GtkModelMenuItem
        * uses this property (along with "icon") to control its child
        * widget.  Once this is merged into GtkMenuItem we can go back to
@@ -2157,13 +2160,9 @@ gtk_menu_shell_tracker_insert_func (GtkMenuTrackerItem *item,
             }
         }
     }
-  else
-    {
-      /* For separators, we bind to the "label" property in case there
-       * is a section heading.
-       */
-      g_object_bind_property (item, "label", widget, "label", G_BINDING_SYNC_CREATE);
-    }
+
+  /* TODO: drop this when we have bindings that ref the source */
+  g_object_set_data_full (G_OBJECT (widget), "GtkMenuTrackerItem", g_object_ref (item), g_object_unref);
 
   gtk_menu_shell_insert (menu_shell, widget, position);
 }


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