* 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/>.
*/
#include "gtkorientable.h"
#include "gtkcelllayout.h"
#include "gtkcellareabox.h"
-#include "gtkcellareaboxcontext.h"
+#include "gtkcellareaboxcontextprivate.h"
#include "gtktypebuiltins.h"
#include "gtkprivate.h"
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.
GSList *contexts;
+ GtkOrientation orientation;
gint spacing;
/* We hold on to the rtl state from a widget we are requested for
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);
}
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);
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;
/* 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));
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);
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);
}
}
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;
}
/* 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,
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);
}
}