diff options
author | Timm Bäder <mail@baedert.org> | 2016-11-12 15:30:55 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2016-11-12 20:37:10 +0100 |
commit | 997fd3c81ef323304592af807e866d93fd16eb24 (patch) | |
tree | b76b2ff58e208e426de947196f229059581db782 /gtk/gtkgrid.c | |
parent | 26746c83691b26d502cfe29b1159929b65ceda91 (diff) | |
download | gtk+-997fd3c81ef323304592af807e866d93fd16eb24.tar.gz |
grid: Use gtk_wiget_measure
Diffstat (limited to 'gtk/gtkgrid.c')
-rw-r--r-- | gtk/gtkgrid.c | 28 |
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); } } |