[gtk+] sizerequest: Use gtk_widget_measure to measure widget sizes



commit d862c5c6dfa19501ad22ace7938af8f88cf993b6
Author: Timm Bäder <mail baedert org>
Date:   Mon Jan 16 18:47:31 2017 +0100

    sizerequest: Use gtk_widget_measure to measure widget sizes

 gtk/gtksizerequest.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 1e16ea8..3c58d34 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -143,9 +143,11 @@ gtk_widget_query_size_for_orientation (GtkWidget        *widget,
               gint minimum_height;
               gint natural_height;
 
-             /* Pull the base natural height from the cache as it's needed to adjust
-              * the proposed 'for_size' */
-             gtk_widget_get_preferred_height (widget, &minimum_height, &natural_height);
+              /* Pull the base natural height from the cache as it's needed to adjust
+               * the proposed 'for_size' */
+              gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL, -1,
+                                  &minimum_height, &natural_height,
+                                  NULL, NULL);
 
               /* convert for_size to unadjusted height (for_size is a proposed allocation) */
               gtk_widget_adjust_size_allocation (widget,
@@ -182,9 +184,11 @@ gtk_widget_query_size_for_orientation (GtkWidget        *widget,
               gint minimum_width;
               gint natural_width;
 
-             /* Pull the base natural width from the cache as it's needed to adjust
-              * the proposed 'for_size' */
-             gtk_widget_get_preferred_width (widget, &minimum_width, &natural_width);
+              /* Pull the base natural width from the cache as it's needed to adjust
+               * the proposed 'for_size' */
+              gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
+                                  &minimum_width, &natural_width,
+                                  NULL, NULL);
 
               /* convert for_size to unadjusted width (for_size is a proposed allocation) */
               gtk_widget_adjust_size_allocation (widget,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]