menu: Fix up CSS node ordering

Keep the bottom arrow node at the end, where it belongs.
This commit is contained in:
Matthias Clasen 2015-11-02 21:49:10 -05:00
parent 25e01a3937
commit 2ba957364d

View File

@ -1444,6 +1444,7 @@ gtk_menu_real_insert (GtkMenuShell *menu_shell,
GtkMenu *menu = GTK_MENU (menu_shell);
GtkMenuPrivate *priv = menu->priv;
AttachInfo *ai = get_attach_info (child);
GtkCssNode *widget_node, *child_node;
ai->left_attach = -1;
ai->right_attach = -1;
@ -1453,6 +1454,10 @@ gtk_menu_real_insert (GtkMenuShell *menu_shell,
if (gtk_widget_get_realized (GTK_WIDGET (menu_shell)))
gtk_widget_set_parent_window (child, priv->bin_window);
widget_node = gtk_widget_get_css_node (GTK_WIDGET (menu));
child_node = gtk_widget_get_css_node (child);
gtk_css_node_insert_before (widget_node, child_node, priv->bottom_arrow);
GTK_MENU_SHELL_CLASS (gtk_menu_parent_class)->insert (menu_shell, child, position);
menu_queue_resize (menu);
@ -5186,6 +5191,7 @@ gtk_menu_attach (GtkMenu *menu,
{
GtkMenuShell *menu_shell;
GtkWidget *parent;
GtkCssNode *widget_node, *child_node;
g_return_if_fail (GTK_IS_MENU (menu));
g_return_if_fail (GTK_IS_MENU_ITEM (child));
@ -5207,6 +5213,10 @@ gtk_menu_attach (GtkMenu *menu,
menu_shell->priv->children = g_list_append (menu_shell->priv->children, child);
widget_node = gtk_widget_get_css_node (GTK_WIDGET (menu));
child_node = gtk_widget_get_css_node (child);
gtk_css_node_insert_before (widget_node, child_node, menu->priv->bottom_arrow);
gtk_widget_set_parent (child, GTK_WIDGET (menu));
menu_queue_resize (menu);