diff options
author | Benjamin Otte <otte@redhat.com> | 2015-02-09 22:51:28 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-03-18 15:23:31 +0100 |
commit | ee91fb71ca5073d30bf7d4f651798d802f7bfa7f (patch) | |
tree | 198153f2cb759d3a114c1d33e2048ac6d3ff6319 /gtk/gtkbox.c | |
parent | b92fe2fa851b5ef61ad3d87fac1cd24babaf216e (diff) | |
download | gtk+-ee91fb71ca5073d30bf7d4f651798d802f7bfa7f.tar.gz |
box: Use CSS nodes instead of widget paths
This is a very simple patch that causes a bunch of overhead. But it
works.
Diffstat (limited to 'gtk/gtkbox.c')
-rw-r--r-- | gtk/gtkbox.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index 818e4d1a97..3a2fb5ac35 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -77,6 +77,7 @@ #include "gtkbox.h" #include "gtkboxprivate.h" +#include "gtkcssnodeprivate.h" #include "gtkintl.h" #include "gtkorientable.h" #include "gtkorientableprivate.h" @@ -1434,17 +1435,25 @@ gtk_box_buildable_init (GtkBuildableIface *iface) } static void -gtk_box_invalidate_order_foreach (GtkWidget *widget) +gtk_box_invalidate_order_foreach (GtkWidget *widget, + gpointer prev) { - _gtk_widget_invalidate_style_context (widget, GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION); + GtkCssNode **previous = prev; + GtkCssNode *cur = gtk_widget_get_css_node (widget); + + if (*previous) + gtk_css_node_set_after (cur, *previous); + + *previous = cur; } static void gtk_box_invalidate_order (GtkBox *box) { + GtkCssNode *previous = NULL; gtk_container_foreach (GTK_CONTAINER (box), - (GtkCallback) gtk_box_invalidate_order_foreach, - NULL); + gtk_box_invalidate_order_foreach, + &previous); } static void @@ -1490,8 +1499,8 @@ gtk_box_pack (GtkBox *box, gtk_widget_freeze_child_notify (child); - gtk_box_invalidate_order (box); gtk_widget_set_parent (child, GTK_WIDGET (box)); + gtk_box_invalidate_order (box); g_signal_connect (child, "notify::visible", G_CALLBACK (box_child_visibility_notify_cb), box); |