summaryrefslogtreecommitdiff
path: root/gtk/gtkbin.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-04-12 22:21:46 -0400
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-04-12 22:21:46 -0400
commitd2c35ec62a595dc02542edae920b6a63dbb57446 (patch)
tree6eaa336a1b72f6bac9c0dcda1a0f27ed17e96bc4 /gtk/gtkbin.c
parent1b2be80f10964e1ded1591294acc603f78980c93 (diff)
downloadgtk+-d2c35ec62a595dc02542edae920b6a63dbb57446.tar.gz
Mega commit to change ->get_desired_size() for ->get_desired_width/height().
This commit changes gtk_extended_layout_get_desired_size() for per dimension variants. Furthermore this commit reverts the actions done in size-groups for now as it needs a different approach. The natural width/height parameters added to aux_info have been changed for a per width cache for heights and a per height cache for widths. gtk-demo is still working, currently sizegroups are not taken into account as mentioned above - size groups need to be alerted both when the widths and heights are updated independantly and then that information needs to repropagate also to other extended layout implementors.
Diffstat (limited to 'gtk/gtkbin.c')
-rw-r--r--gtk/gtkbin.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c
index d2a052caad..f8c9b7522d 100644
--- a/gtk/gtkbin.c
+++ b/gtk/gtkbin.c
@@ -168,17 +168,16 @@ get_child_padding_delta (GtkBin *bin,
gint *delta_h,
gint *delta_v)
{
- GtkRequisition min_req, child_min;
+ gint hmin, vmin, child_hmin, child_vmin;
- gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (bin),
- &min_req, NULL);
+ gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin), &hmin, NULL);
+ gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin), &vmin, NULL);
- gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (bin->child),
- &child_min, NULL);
+ gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin->child), &child_hmin, NULL);
+ gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child), &child_vmin, NULL);
-
- *delta_h = min_req.width - child_min.width;
- *delta_v = min_req.height - child_min.height;
+ *delta_h = hmin - child_hmin;
+ *delta_v = vmin - child_vmin;
}
static void
@@ -205,7 +204,8 @@ gtk_bin_get_width_for_height (GtkExtendedLayout *layout,
*natural_width = child_nat + hdelta;
}
else
- parent_extended_layout_iface->get_height_for_width (layout, height, minimum_width, natural_width);
+ GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, minimum_width, natural_width);
+/* parent_extended_layout_iface->get_height_for_width (layout, height, minimum_width, natural_width); */
}
static void
@@ -232,7 +232,8 @@ gtk_bin_get_height_for_width (GtkExtendedLayout *layout,
*natural_height = child_nat + vdelta;
}
else
- parent_extended_layout_iface->get_height_for_width (layout, width, minimum_height, natural_height);
+ GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, minimum_height, natural_height);
+/* parent_extended_layout_iface->get_height_for_width (layout, width, minimum_height, natural_height); */
}