[gtk+/wip/gmenu] GtkApplication: Insert separators after sections
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/gmenu] GtkApplication: Insert separators after sections
- Date: Sun, 27 Nov 2011 04:45:38 +0000 (UTC)
commit 5a2030517dd05bd3b35b41caa5a41f41b12ebfb0
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Nov 26 23:44:37 2011 -0500
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.
gtk/gtkapplication.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index fa38327..cd57552 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -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)))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]