summaryrefslogtreecommitdiff
path: root/gtk/gtkprogressbar.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/gtkprogressbar.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/gtkprogressbar.c')
-rw-r--r--gtk/gtkprogressbar.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index 2b325e1b6e..0a845a0148 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -345,26 +345,14 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class)
}
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