GtkApplication: Insert separators after sections

The previous code was only inserting a separator when a new
section was starting right away, which may not always be the
case.
This commit is contained in:
Matthias Clasen 2011-11-26 23:44:37 -05:00 committed by Ryan Lortie
parent 9131849eec
commit 5705a330c2

View File

@ -555,7 +555,6 @@ append_items_from_model (GtkMenuShell *menu,
w = gtk_separator_menu_item_new ();
gtk_widget_show (w);
gtk_menu_shell_append (menu, w);
*need_separator = FALSE;
}
@ -579,6 +578,14 @@ append_items_from_model (GtkMenuShell *menu,
continue;
}
if (*need_separator)
{
w = gtk_separator_menu_item_new ();
gtk_widget_show (w);
gtk_menu_shell_append (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)))