summaryrefslogtreecommitdiff
path: root/gtk/gtkcellareabox.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-11-26 13:23:01 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-11-26 21:37:51 +0900
commitfa3c8f182edcddcfb948513fbdadeeec2e059fe0 (patch)
tree776c34d7f04c842bcdd3a84956bed3e78a36208a /gtk/gtkcellareabox.c
parent7fc7bd613b1a045a79ce9b1c0b8968c3e7df1d24 (diff)
downloadgtk+-fa3c8f182edcddcfb948513fbdadeeec2e059fe0.tar.gz
Revert "Removed tons of api that we dont absolutely need in GtkCellAreaContext:"
This reverts commit 5f7787ab2ead2cdd11ebe17b16dd9498daaaf9c5.
Diffstat (limited to 'gtk/gtkcellareabox.c')
-rw-r--r--gtk/gtkcellareabox.c57
1 files changed, 39 insertions, 18 deletions
diff --git a/gtk/gtkcellareabox.c b/gtk/gtkcellareabox.c
index 8950c53c0f..02ec53f9e3 100644
--- a/gtk/gtkcellareabox.c
+++ b/gtk/gtkcellareabox.c
@@ -1284,7 +1284,8 @@ compute_size (GtkCellAreaBox *box,
for (i = 0; i < priv->groups->len; i++)
{
CellGroup *group = &g_array_index (priv->groups, CellGroup, i);
- gint group_min = 0, group_nat = 0;
+ gint group_min_size = 0;
+ gint group_nat_size = 0;
for (list = group->cells; list; list = list->next)
{
@@ -1304,33 +1305,42 @@ compute_size (GtkCellAreaBox *box,
min_size += priv->spacing;
nat_size += priv->spacing;
}
-
- if (group_min > 0)
+
+ if (group_min_size > 0)
{
- group_min += priv->spacing;
- group_nat += priv->spacing;
+ group_min_size += priv->spacing;
+ group_nat_size += priv->spacing;
}
-
- min_size += renderer_min_size;
- nat_size += renderer_nat_size;
- group_min += renderer_min_size;
- group_nat += renderer_nat_size;
+
+ min_size += renderer_min_size;
+ nat_size += renderer_nat_size;
+ group_min_size += renderer_min_size;
+ group_nat_size += renderer_nat_size;
}
else
{
- min_size = MAX (min_size, renderer_min_size);
- nat_size = MAX (nat_size, renderer_nat_size);
- group_min = MAX (group_min, renderer_min_size);
- group_nat = MAX (group_nat, renderer_nat_size);
+ min_size = MAX (min_size, renderer_min_size);
+ nat_size = MAX (nat_size, renderer_nat_size);
+ group_min_size = MAX (group_min_size, renderer_min_size);
+ group_nat_size = MAX (group_nat_size, renderer_nat_size);
}
}
- if (for_size < 0)
+ 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);
+ else
+ gtk_cell_area_box_context_push_group_width_for_height (context, group->id, for_size,
+ group_min_size, group_nat_size);
+ }
+ else
{
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_cell_area_box_context_push_group_width (context, group->id, group_min, group_nat);
+ if (for_size < 0)
+ 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 (context, group->id, group_min, group_nat);
+ gtk_cell_area_box_context_push_group_height_for_width (context, group->id, for_size,
+ group_min_size, group_nat_size);
}
}
@@ -1519,6 +1529,17 @@ compute_size_for_opposing_orientation (GtkCellAreaBox *box,
min_size = MAX (min_size, group_min);
nat_size = MAX (nat_size, group_nat);
+
+ if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ 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,
+ group_min, group_nat);
+ }
}
*minimum_size = min_size;