[gtk+] stack: Use measure() to measure child widget



commit 82d38e35f81cd92ffb2365da2ad0c5da3083cbe7
Author: Timm Bäder <mail baedert org>
Date:   Thu Oct 27 09:38:45 2016 +0200

    stack: Use measure() to measure child widget
    
    Simpler code this way \o/

 gtk/gtkstack.c |   15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index fb30df8..9036579 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -2330,20 +2330,7 @@ gtk_stack_measure (GtkCssGadget   *gadget,
 
       if (gtk_widget_get_visible (child))
         {
-          if (orientation == GTK_ORIENTATION_VERTICAL)
-            {
-              if (for_size < 0)
-                gtk_widget_get_preferred_height (child, &child_min, &child_nat);
-              else
-                gtk_widget_get_preferred_height_for_width (child, for_size, &child_min, &child_nat);
-            }
-          else
-            {
-              if (for_size < 0)
-                gtk_widget_get_preferred_width (child, &child_min, &child_nat);
-              else
-                gtk_widget_get_preferred_width_for_height (child, for_size, &child_min, &child_nat);
-            }
+          gtk_widget_measure (child, orientation, for_size, &child_min, &child_nat, NULL, NULL);
 
           *minimum = MAX (*minimum, child_min);
           *natural = MAX (*natural, child_nat);


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