summaryrefslogtreecommitdiff
path: root/gtk/gtkaccellabel.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/gtkaccellabel.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/gtkaccellabel.c')
-rw-r--r--gtk/gtkaccellabel.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c
index e4bbdd0efb..bd2a180662 100644
--- a/gtk/gtkaccellabel.c
+++ b/gtk/gtkaccellabel.c
@@ -268,26 +268,14 @@ gtk_accel_label_get_property (GObject *object,
}
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