[gtk/popover-menu-custom-child] fixup: Only allow one child per slot



commit ee73b76b79b4eafffc0a9de7e946ff03b3759580
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Oct 21 11:52:12 2020 -0400

    fixup: Only allow one child per slot
    
    We're using a bin layout, so adding more than one
    child to the same slot is not going to work out well.

 gtk/gtkmenusectionbox.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gtk/gtkmenusectionbox.c b/gtk/gtkmenusectionbox.c
index 2c1d485f11..a46420fc32 100644
--- a/gtk/gtkmenusectionbox.c
+++ b/gtk/gtkmenusectionbox.c
@@ -698,6 +698,9 @@ gtk_menu_section_box_add_custom (GtkPopoverMenu *popover,
   if (slot == NULL)
     return FALSE;
 
+  if (gtk_widget_get_first_child (slot))
+    return FALSE;
+
   gtk_widget_insert_before (child, slot, NULL);
   return TRUE;
 }


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