summaryrefslogtreecommitdiff
path: root/gtk/gtkgrid.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2016-11-12 15:30:55 +0100
committerTimm Bäder <mail@baedert.org>2016-11-12 20:37:10 +0100
commit997fd3c81ef323304592af807e866d93fd16eb24 (patch)
treeb76b2ff58e208e426de947196f229059581db782 /gtk/gtkgrid.c
parent26746c83691b26d502cfe29b1159929b65ceda91 (diff)
downloadgtk+-997fd3c81ef323304592af807e866d93fd16eb24.tar.gz
grid: Use gtk_wiget_measure
Diffstat (limited to 'gtk/gtkgrid.c')
-rw-r--r--gtk/gtkgrid.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c
index 729904c025..d96ce7fcdb 100644
--- a/gtk/gtkgrid.c
+++ b/gtk/gtkgrid.c
@@ -662,30 +662,26 @@ compute_request_for_child (GtkGridRequest *request,
*minimum_baseline = -1;
if (natural_baseline)
*natural_baseline = -1;
+
if (contextual)
{
gint size;
size = compute_allocation_for_child (request, child, 1 - orientation);
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_get_preferred_width_for_height (child->widget,
- size,
- minimum, natural);
- else
- gtk_widget_get_preferred_height_and_baseline_for_width (child->widget,
- size,
- minimum, natural,
- minimum_baseline, natural_baseline);
+
+ gtk_widget_measure (child->widget,
+ orientation,
+ size,
+ minimum, natural,
+ minimum_baseline, natural_baseline);
}
else
{
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_get_preferred_width (child->widget, minimum, natural);
- else
- gtk_widget_get_preferred_height_and_baseline_for_width (child->widget,
- -1,
- minimum, natural,
- minimum_baseline, natural_baseline);
+ gtk_widget_measure (child->widget,
+ orientation,
+ -1,
+ minimum, natural,
+ minimum_baseline, natural_baseline);
}
}