diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-04-29 11:48:52 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-04-29 12:19:53 -0400 |
commit | f3ba001a1de2c961494e191910dd5017f769bdf1 (patch) | |
tree | 849addb8b00d678d269a491443b3cf0db71ceb09 /gtk/gtkmenusectionbox.c | |
parent | 4f293c427c716374179410318b1c0812e20ffe45 (diff) | |
download | gtk+-f3ba001a1de2c961494e191910dd5017f769bdf1.tar.gz |
GtkMenuSectionBox: Always show separators for labeled sections
...unless they are empty.
Diffstat (limited to 'gtk/gtkmenusectionbox.c')
-rw-r--r-- | gtk/gtkmenusectionbox.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk/gtkmenusectionbox.c b/gtk/gtkmenusectionbox.c index 62ab3182e2..935ddf51af 100644 --- a/gtk/gtkmenusectionbox.c +++ b/gtk/gtkmenusectionbox.c @@ -84,16 +84,21 @@ gtk_menu_section_box_sync_separators (GtkMenuSectionBox *box, gint *n_items) { gboolean should_have_separator; + gboolean has_separator; + gboolean has_label; gint n_items_before = *n_items; gtk_container_foreach (GTK_CONTAINER (box->item_box), gtk_menu_section_box_sync_item, n_items); - should_have_separator = n_items_before > 0 && *n_items > n_items_before; - if (box->separator == NULL) return; - if (should_have_separator == (gtk_widget_get_parent (box->separator) != NULL)) + has_separator = gtk_widget_get_parent (box->separator) != NULL; + has_label = !GTK_IS_SEPARATOR (box->separator); + + should_have_separator = (has_label || n_items_before > 0) && *n_items > n_items_before; + + if (should_have_separator == has_separator) return; if (should_have_separator) |