summaryrefslogtreecommitdiff
path: root/gtk/gtkbin.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-04-03 20:40:50 -0400
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-04-03 20:59:28 -0400
commita33053db749197c7e3cdcf84f27ca6e8ed37bca6 (patch)
tree56b306a255cca107609e4a7a6c66a4de4473500e /gtk/gtkbin.c
parent8413f22d9034e0cde3d9bd11f786e09d0dcb8313 (diff)
downloadgtk+-a33053db749197c7e3cdcf84f27ca6e8ed37bca6.tar.gz
Fixed extended layout implementors to not call ->get_desired_size() directly
Getting the desired size of a GtkWidget must always be done with gtk_widget_get_desired_size() and never with gtk_extended_layout_get_desired_size() directly as the former passes through size group logic and updates the widget->requisition cache.
Diffstat (limited to 'gtk/gtkbin.c')
-rw-r--r--gtk/gtkbin.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c
index 8da28ef188..e141529e5f 100644
--- a/gtk/gtkbin.c
+++ b/gtk/gtkbin.c
@@ -156,12 +156,11 @@ gtk_bin_extended_layout_get_desired_size (GtkExtendedLayout *layout,
GtkRequisition *minimum_size,
GtkRequisition *natural_size)
{
- GtkBin *bin = GTK_BIN (layout);
+ GtkWidget *child;
- g_return_if_fail (GTK_IS_EXTENDED_LAYOUT (bin->child));
+ child = gtk_bin_get_child (GTK_BIN (layout));
- gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (bin->child),
- minimum_size, natural_size);
+ gtk_widget_get_desired_size (child, minimum_size, natural_size);
}
static void
@@ -170,11 +169,11 @@ gtk_bin_extended_layout_get_width_for_height (GtkExtendedLayout *layout,
gint *minimum_width,
gint *natural_width)
{
- GtkBin *bin = GTK_BIN (layout);
+ GtkWidget *child;
- g_return_if_fail (GTK_IS_EXTENDED_LAYOUT (bin->child));
+ child = gtk_bin_get_child (GTK_BIN (layout));
- gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (bin->child),
+ gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child),
height, minimum_width, natural_width);
}
@@ -184,11 +183,11 @@ gtk_bin_extended_layout_get_height_for_width (GtkExtendedLayout *layout,
gint *minimum_height,
gint *natural_height)
{
- GtkBin *bin = GTK_BIN (layout);
+ GtkWidget *child;
- g_return_if_fail (GTK_IS_EXTENDED_LAYOUT (bin->child));
+ child = gtk_bin_get_child (GTK_BIN (layout));
- gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (bin->child),
+ gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (child),
width, minimum_height, natural_height);
}