[egg-list-box/flow-box-enhancements] Rename get_average_item size



commit 7a0310fdfeead640a4e60296db58eca1f504bc76
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Sep 28 01:26:15 2013 -0400

    Rename get_average_item size
    
    It computes a maximum, not an average, so call it
    get_max_item_size.

 egg-flow-box.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/egg-flow-box.c b/egg-flow-box.c
index ee0783b..7bd0e0e 100644
--- a/egg-flow-box.c
+++ b/egg-flow-box.c
@@ -601,10 +601,10 @@ get_visible_children (EggFlowBox *box)
  * equal widths or heights
  */
 static void
-get_average_item_size (EggFlowBox     *box,
-                       GtkOrientation  orientation,
-                       gint           *min_size,
-                       gint           *nat_size)
+get_max_item_size (EggFlowBox     *box,
+                   GtkOrientation  orientation,
+                   gint           *min_size,
+                   gint           *nat_size)
 {
   EggFlowBoxPrivate *priv = box->priv;
   GSequenceIter *iter;
@@ -965,7 +965,7 @@ egg_flow_box_size_allocate (GtkWidget     *widget,
    * Deal with ALIGNED/HOMOGENEOUS modes first, start with
    * initial guesses at item/line sizes
    */
-  get_average_item_size (box, priv->orientation, &min_item_size, &nat_item_size);
+  get_max_item_size (box, priv->orientation, &min_item_size, &nat_item_size);
   if (nat_item_size <= 0)
     return;
 
@@ -1463,10 +1463,10 @@ egg_flow_box_get_preferred_width (GtkWidget *widget,
            * need enough width for the widest row */
           if (min_items == 1)
             {
-              get_average_item_size (box,
-                                     GTK_ORIENTATION_HORIZONTAL,
-                                     &min_item_width,
-                                     &nat_item_width);
+              get_max_item_size (box,
+                                 GTK_ORIENTATION_HORIZONTAL,
+                                 &min_item_width,
+                                 &nat_item_width);
 
               min_width += min_item_width;
               nat_width += nat_item_width;
@@ -1495,8 +1495,8 @@ egg_flow_box_get_preferred_width (GtkWidget *widget,
       else /* In homogeneous mode; horizontally oriented boxs
             * give the same width to all children */
         {
-          get_average_item_size (box, GTK_ORIENTATION_HORIZONTAL,
-                                 &min_item_width, &nat_item_width);
+          get_max_item_size (box, GTK_ORIENTATION_HORIZONTAL,
+                             &min_item_width, &nat_item_width);
 
           min_width += min_item_width * min_items;
           min_width += (min_items -1) * priv->column_spacing;
@@ -1560,8 +1560,8 @@ egg_flow_box_get_preferred_height (GtkWidget *widget,
            * need enough height for the tallest column */
           if (min_items == 1)
             {
-              get_average_item_size (box, GTK_ORIENTATION_VERTICAL,
-                                     &min_item_height, &nat_item_height);
+              get_max_item_size (box, GTK_ORIENTATION_VERTICAL,
+                                 &min_item_height, &nat_item_height);
 
               min_height += min_item_height;
               nat_height += nat_item_height;
@@ -1591,10 +1591,10 @@ egg_flow_box_get_preferred_height (GtkWidget *widget,
       else /* In homogeneous mode; vertically oriented boxs
             * give the same height to all children */
         {
-          get_average_item_size (box,
-                                 GTK_ORIENTATION_VERTICAL,
-                                 &min_item_height,
-                                 &nat_item_height);
+          get_max_item_size (box,
+                             GTK_ORIENTATION_VERTICAL,
+                             &min_item_height,
+                             &nat_item_height);
 
           min_height += min_item_height * min_items;
           min_height += (min_items -1) * priv->row_spacing;
@@ -1646,7 +1646,7 @@ egg_flow_box_get_preferred_height_for_width (GtkWidget *widget,
       if (avail_size <= 0)
         goto out;
 
-      get_average_item_size (box, GTK_ORIENTATION_HORIZONTAL, &min_item_width, &nat_item_width);
+      get_max_item_size (box, GTK_ORIENTATION_HORIZONTAL, &min_item_width, &nat_item_width);
       if (nat_item_width <= 0)
         goto out;
       /* By default flow at the natural item width */
@@ -1809,7 +1809,7 @@ egg_flow_box_get_preferred_width_for_height (GtkWidget *widget,
       if (avail_size <= 0)
         goto out;
 
-      get_average_item_size (box, GTK_ORIENTATION_VERTICAL, &min_item_height, &nat_item_height);
+      get_max_item_size (box, GTK_ORIENTATION_VERTICAL, &min_item_height, &nat_item_height);
 
       /* By default flow at the natural item width */
       line_length = avail_size / (nat_item_height + priv->row_spacing);


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