[gtk+/wip/gmenu: 23/87] testgmenu: Insert separators after sections



commit ff6333f04a49eb3f39f6eca0b7fd5f411d9a67a0
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Nov 26 23:42:33 2011 -0500

    testgmenu: Insert separators after sections
    
    The previous code was only inserting a separator when a new
    section was starting right away.

 tests/testgmenu.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/tests/testgmenu.c b/tests/testgmenu.c
index faa35e2..ab70a74 100644
--- a/tests/testgmenu.c
+++ b/tests/testgmenu.c
@@ -289,7 +289,6 @@ append_items_from_model (GtkWidget    *menu,
       w = gtk_separator_menu_item_new ();
       gtk_widget_show (w);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
-
       *need_separator = FALSE;
     }
 
@@ -318,6 +317,14 @@ append_items_from_model (GtkWidget    *menu,
           continue;
         }
 
+      if (*need_separator)
+        {
+          w = gtk_separator_menu_item_new ();
+          gtk_widget_show (w);
+          gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
+          *need_separator = FALSE;
+        }
+
       menuitem = create_menuitem_from_model (model, i, group);
 
       if ((m = g_menu_model_get_item_link (model, i, G_MENU_LINK_SUBMENU)))



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