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



commit 8165b641cd1c215b3eb5f3178db3d28fc2ed62d5
Author: Timm Bäder <mail baedert org>
Date:   Fri Feb 17 17:46:47 2017 +0100

    paned: Use gtk_widget_measure to measure widget sizes

 gtk/gtkpaned.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 13edfd4..2393847 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -1285,12 +1285,12 @@ gtk_paned_allocate (GtkCssGadget        *gadget,
         {
           gint child1_width, child2_width;
 
-          gtk_widget_get_preferred_width_for_height (priv->child1,
-                                                     allocation->height,
-                                                     &child1_width, NULL);
-          gtk_widget_get_preferred_width_for_height (priv->child2,
-                                                     allocation->height,
-                                                     &child2_width, NULL);
+          gtk_widget_measure (priv->child1, GTK_ORIENTATION_HORIZONTAL,
+                              allocation->height,
+                              &child1_width, NULL, NULL, NULL);
+          gtk_widget_measure (priv->child2, GTK_ORIENTATION_HORIZONTAL,
+                              allocation->height,
+                              &child2_width, NULL, NULL, NULL);
 
           gtk_paned_calc_position (paned,
                                    MAX (1, allocation->width - handle_size),
@@ -1341,12 +1341,12 @@ gtk_paned_allocate (GtkCssGadget        *gadget,
         {
           gint child1_height, child2_height;
 
-          gtk_widget_get_preferred_height_for_width (priv->child1,
-                                                     allocation->width,
-                                                     &child1_height, NULL);
-          gtk_widget_get_preferred_height_for_width (priv->child2,
-                                                     allocation->width,
-                                                     &child2_height, NULL);
+          gtk_widget_measure (priv->child1, GTK_ORIENTATION_VERTICAL,
+                              allocation->width,
+                              &child1_height, NULL, NULL, NULL);
+          gtk_widget_measure (priv->child2, GTK_ORIENTATION_VERTICAL,
+                              allocation->width,
+                              &child2_height, NULL, NULL, NULL);
 
           gtk_paned_calc_position (paned,
                                    MAX (1, allocation->height - handle_size),


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