summaryrefslogtreecommitdiff
path: root/gtk/gtkcheckmenuitem.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-12-12 02:02:04 +0100
committerBenjamin Otte <otte@redhat.com>2015-12-12 02:16:04 +0100
commit971a277419800fbcaa9dafa8bb68fdb19d866aee (patch)
tree0ce504568b8718d82d87da6045a39ea0a497be1a /gtk/gtkcheckmenuitem.c
parent0ad259a178f5172364c3acce41f8d5cde0f571c6 (diff)
downloadgtk+-971a277419800fbcaa9dafa8bb68fdb19d866aee.tar.gz
cssnode: Change style-changed signal
Instead of having old and new style, now have a GtkCssStyleChange opaque object that will compute the changes you are interested in for you. This simplifies change signal handlers quite a bit and avoids lots of repeated computation in every signal handler.
Diffstat (limited to 'gtk/gtkcheckmenuitem.c')
-rw-r--r--gtk/gtkcheckmenuitem.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c
index f1aa0a7f87..d8654a9d8e 100644
--- a/gtk/gtkcheckmenuitem.c
+++ b/gtk/gtkcheckmenuitem.c
@@ -525,26 +525,14 @@ gtk_check_menu_item_get_draw_as_radio (GtkCheckMenuItem *check_menu_item)
}
static void
-node_style_changed_cb (GtkCssNode *node,
- GtkCssStyle *old_style,
- GtkCssStyle *new_style,
- GtkWidget *widget)
+node_style_changed_cb (GtkCssNode *node,
+ GtkCssStyleChange *change,
+ GtkWidget *widget)
{
- GtkBitmask *changes;
- static GtkBitmask *affects_size = NULL;
-
- if (G_UNLIKELY (affects_size == NULL))
- affects_size = _gtk_css_style_property_get_mask_affecting (GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP);
-
- changes = _gtk_bitmask_new ();
- changes = gtk_css_style_add_difference (changes, old_style, new_style);
-
- if (_gtk_bitmask_intersects (changes, affects_size))
+ if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP))
gtk_widget_queue_resize (widget);
else
gtk_widget_queue_draw (widget);
-
- _gtk_bitmask_free (changes);
}
static void