diff options
author | Benjamin Otte <otte@redhat.com> | 2015-09-27 12:29:05 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-10-28 19:44:28 +0100 |
commit | 3ff894c2013f41a90b4fec4ffbefb17fcd2b45ab (patch) | |
tree | 8aa2a14b6291d96a99d9627e276acc06e4707eb3 | |
parent | 58d506fb115596beaeb8383e2ed3af3febd6934d (diff) | |
download | gtk+-3ff894c2013f41a90b4fec4ffbefb17fcd2b45ab.tar.gz |
widget: Add a function that does actual resize
It's just shuffling code around.
-rw-r--r-- | gtk/gtksizegroup.c | 4 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 8 | ||||
-rw-r--r-- | gtk/gtkwidgetprivate.h | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c index 11f050c624..3eddc1fddb 100644 --- a/gtk/gtksizegroup.c +++ b/gtk/gtksizegroup.c @@ -26,7 +26,6 @@ #include "gtktypebuiltins.h" #include "gtkprivate.h" #include "gtksizegroup-private.h" -#include "gtksizerequestcacheprivate.h" #include "gtkwidgetprivate.h" #include "gtkcontainerprivate.h" @@ -218,8 +217,7 @@ queue_resize_on_widget (GtkWidget *widget, do { - _gtk_widget_set_alloc_needed (parent, TRUE); - _gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (parent)); + gtk_widget_queue_resize_on_widget (parent); if (!check_siblings || _gtk_widget_get_sizegroups (parent) == NULL) { diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index b0713bff44..4b34153039 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -16157,10 +16157,12 @@ _gtk_widget_get_alloc_needed (GtkWidget *widget) } void -_gtk_widget_set_alloc_needed (GtkWidget *widget, - gboolean alloc_needed) +gtk_widget_queue_resize_on_widget (GtkWidget *widget) { - widget->priv->alloc_needed = alloc_needed; + GtkWidgetPrivate *priv = widget->priv; + + priv->alloc_needed = TRUE; + _gtk_size_request_cache_clear (&priv->requests); } void diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h index aefa4f8699..aa69230301 100644 --- a/gtk/gtkwidgetprivate.h +++ b/gtk/gtkwidgetprivate.h @@ -72,6 +72,7 @@ struct _GtkWidgetPrivate guint in_reparent : 1; /* Queue-resize related flags */ + guint resize_needed : 1; /* queue_resize() has been called but no get_preferred_size() yet */ guint alloc_needed : 1; /* Expand-related flags */ @@ -165,8 +166,7 @@ gboolean _gtk_widget_get_shadowed (GtkWidget *widget); void _gtk_widget_set_shadowed (GtkWidget *widget, gboolean shadowed); gboolean _gtk_widget_get_alloc_needed (GtkWidget *widget); -void _gtk_widget_set_alloc_needed (GtkWidget *widget, - gboolean alloc_needed); +void gtk_widget_queue_resize_on_widget (GtkWidget *widget); void _gtk_widget_draw (GtkWidget *widget, cairo_t *cr); void _gtk_widget_scale_changed (GtkWidget *widget); |