diff options
author | Timm Bäder <mail@baedert.org> | 2017-06-18 15:45:42 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-07-19 21:27:14 -0400 |
commit | c2abb698bea9e9f16f3187e5dbb0f32ec555d694 (patch) | |
tree | 499d6f3d36102b4af5b432c2e7d45b70de5ce931 /gtk/gtkframe.c | |
parent | e36ddfec177773ba993a8f8dcd566cf3fb3bb5aa (diff) | |
download | gtk+-c2abb698bea9e9f16f3187e5dbb0f32ec555d694.tar.gz |
Replace a few get_content_allocation calls with get_content_size
The position of the content allocation is almost never relevant since
it's 0/0 for measure, size_allocate and snapshot.
Diffstat (limited to 'gtk/gtkframe.c')
-rw-r--r-- | gtk/gtkframe.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index c2f6cd49ea..ff59bac030 100644 --- a/gtk/gtkframe.c +++ b/gtk/gtkframe.c @@ -677,10 +677,10 @@ gtk_frame_real_compute_child_allocation (GtkFrame *frame, GtkAllocation *child_allocation) { GtkFramePrivate *priv = frame->priv; - GtkAllocation allocation; + int frame_width, frame_height; gint height; - gtk_widget_get_content_allocation (GTK_WIDGET (frame), &allocation); + gtk_widget_get_content_size (GTK_WIDGET (frame), &frame_width, &frame_height); if (priv->label_widget) { @@ -688,7 +688,7 @@ gtk_frame_real_compute_child_allocation (GtkFrame *frame, gtk_widget_measure (priv->label_widget, GTK_ORIENTATION_HORIZONTAL, -1, NULL, &nat_width, NULL, NULL); - width = MIN (allocation.width, nat_width); + width = MIN (frame_width, nat_width); gtk_widget_measure (priv->label_widget, GTK_ORIENTATION_VERTICAL, width, &height, NULL, NULL, NULL); } @@ -697,8 +697,8 @@ gtk_frame_real_compute_child_allocation (GtkFrame *frame, child_allocation->x = 0; child_allocation->y = height; - child_allocation->width = MAX (1, allocation.width); - child_allocation->height = MAX (1, allocation.height - height); + child_allocation->width = MAX (1, frame_width); + child_allocation->height = MAX (1, frame_height - height); } static void |