]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkcellareabox.c
Rename property to be more neutral
[~andy/gtk] / gtk / gtkcellareabox.c
index f81d1c2d9c84d07b92c2e2a86f080cbe3b27fe55..aa05220ae1d1973b89ff07fb730f6cf994babb59 100644 (file)
@@ -16,9 +16,7 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 
@@ -52,7 +50,8 @@
 #include "gtkorientable.h"
 #include "gtkcelllayout.h"
 #include "gtkcellareabox.h"
-#include "gtkcellareaboxcontext.h"
+#include "gtkcellareaboxcontextprivate.h"
+#include "gtktypebuiltins.h"
 #include "gtkprivate.h"
 
 
@@ -200,8 +199,6 @@ static GSList        *get_allocated_cells    (GtkCellAreaBox        *box,
 
 struct _GtkCellAreaBoxPrivate
 {
-  GtkOrientation   orientation;
-
   /* We hold on to the previously focused cell when navigating
    * up and down in a horizontal box (or left and right on a vertical one)
    * this way we always re-enter the last focused cell.
@@ -214,6 +211,7 @@ struct _GtkCellAreaBoxPrivate
 
   GSList          *contexts;
 
+  GtkOrientation   orientation;
   gint             spacing;
 
   /* We hold on to the rtl state from a widget we are requested for
@@ -635,8 +633,8 @@ init_context_group (GtkCellAreaBox        *box,
       align_groups[i]  = group->align;
     }
 
-  /* This call implies reseting the request info */
-  gtk_cell_area_box_init_groups (context, priv->groups->len, expand_groups, align_groups);
+  /* This call implies resetting the request info */
+  _gtk_cell_area_box_init_groups (context, priv->groups->len, expand_groups, align_groups);
   g_free (expand_groups);
   g_free (align_groups);
 }
@@ -829,7 +827,7 @@ get_allocated_cells (GtkCellAreaBox        *box,
   gint                      for_size, full_size;
   gboolean                  rtl;
 
-  group_allocs = gtk_cell_area_box_context_get_orientation_allocs (context, &n_allocs);
+  group_allocs = _gtk_cell_area_box_context_get_orientation_allocs (context, &n_allocs);
   if (!group_allocs)
     return allocate_cells_manually (box, widget, width, height);
 
@@ -865,6 +863,9 @@ get_allocated_cells (GtkCellAreaBox        *box,
           AllocatedCell *cell;
          gint           cell_position, cell_size;
 
+         if (!gtk_cell_renderer_get_visible (info->renderer))
+           continue;
+
          /* If were not aligned, place the cell after the last cell */
          if (info->align)
            position = cell_position = group_allocs[i].position;
@@ -1060,6 +1061,7 @@ gtk_cell_area_box_set_property (GObject       *object,
 
       /* Notify that size needs to be requested again */
       reset_contexts (box);
+
       break;
     case PROP_SPACING:
       gtk_cell_area_box_set_spacing (box, g_value_get_int (value));
@@ -1475,7 +1477,7 @@ gtk_cell_area_box_copy_context (GtkCellArea        *area,
   GtkCellAreaBox        *box  = GTK_CELL_AREA_BOX (area);
   GtkCellAreaBoxPrivate *priv = box->priv;
   GtkCellAreaContext    *copy =
-    (GtkCellAreaContext *)gtk_cell_area_box_context_copy (GTK_CELL_AREA_BOX (area),
+    (GtkCellAreaContext *)_gtk_cell_area_box_context_copy (GTK_CELL_AREA_BOX (area),
                                                           GTK_CELL_AREA_BOX_CONTEXT (context));
 
   priv->contexts = g_slist_prepend (priv->contexts, copy);
@@ -1560,17 +1562,17 @@ compute_size (GtkCellAreaBox        *box,
       if (orientation == GTK_ORIENTATION_HORIZONTAL)
         {
           if (for_size < 0)
-            gtk_cell_area_box_context_push_group_width (context, group->id, group_min_size, group_nat_size);
+            _gtk_cell_area_box_context_push_group_width (context, group->id, group_min_size, group_nat_size);
           else
-            gtk_cell_area_box_context_push_group_width_for_height (context, group->id, for_size,
+            _gtk_cell_area_box_context_push_group_width_for_height (context, group->id, for_size,
                                                                    group_min_size, group_nat_size);
         }
       else
         {
           if (for_size < 0)
-            gtk_cell_area_box_context_push_group_height (context, group->id, group_min_size, group_nat_size);
+            _gtk_cell_area_box_context_push_group_height (context, group->id, group_min_size, group_nat_size);
           else
-            gtk_cell_area_box_context_push_group_height_for_width (context, group->id, for_size,
+            _gtk_cell_area_box_context_push_group_height_for_width (context, group->id, for_size,
                                                                    group_min_size, group_nat_size);
         }
     }
@@ -1719,9 +1721,9 @@ compute_size_for_opposing_orientation (GtkCellAreaBox        *box,
   n_expand_groups = count_expand_groups (box);
 
   if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
-    orientation_sizes = gtk_cell_area_box_context_get_widths (context, &n_groups);
+    orientation_sizes = _gtk_cell_area_box_context_get_widths (context, &n_groups);
   else
-    orientation_sizes = gtk_cell_area_box_context_get_heights (context, &n_groups);
+    orientation_sizes = _gtk_cell_area_box_context_get_heights (context, &n_groups);
 
   /* First start by naturally allocating space among groups of cells */
   avail_size -= (n_groups - 1) * priv->spacing;
@@ -1764,7 +1766,7 @@ compute_size_for_opposing_orientation (GtkCellAreaBox        *box,
         }
 
       /* Now we have the allocation for the group,
-       * request it's height-for-width
+       * request its height-for-width
        */
       compute_group_size_for_opposing_orientation (box, group, widget,
                                                    orientation_sizes[i].minimum_size,
@@ -1775,12 +1777,12 @@ compute_size_for_opposing_orientation (GtkCellAreaBox        *box,
 
       if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
         {
-          gtk_cell_area_box_context_push_group_height_for_width (context, group_idx, for_size,
+          _gtk_cell_area_box_context_push_group_height_for_width (context, group_idx, for_size,
                                                                  group_min, group_nat);
         }
       else
         {
-          gtk_cell_area_box_context_push_group_width_for_height (context, group_idx, for_size,
+          _gtk_cell_area_box_context_push_group_width_for_height (context, group_idx, for_size,
                                                                  group_min, group_nat);
         }
     }