summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Arne Petersen <jpetersen@jpetersen.org>2010-04-01 11:53:41 +0200
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-04-03 20:59:27 -0400
commit0fbdb3c73f29905dc3f5a5776e3e3f142b9722c2 (patch)
treeafd085aa83d71ee636c781c0000ee7a879f3bc31
parentc4dec47536c375660e8cd7d869efbec7412f918e (diff)
downloadgdk-pixbuf-0fbdb3c73f29905dc3f5a5776e3e3f142b9722c2.tar.gz
Take extended layout into account in viewport
Make sure the right height is used in GtkViewPort.
-rw-r--r--gtk/gtkviewport.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index bfda9f28b..3f3d34628 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -26,6 +26,7 @@
#include "config.h"
#include "gtkviewport.h"
+#include "gtkextendedlayout.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
@@ -417,10 +418,23 @@ viewport_set_vadjustment_values (GtkViewport *viewport,
if (bin->child && gtk_widget_get_visible (bin->child))
{
- GtkRequisition child_requisition;
-
- gtk_widget_get_child_requisition (bin->child, &child_requisition);
- vadjustment->upper = MAX (child_requisition.height, view_allocation.height);
+ if (GTK_IS_EXTENDED_LAYOUT (bin->child))
+ {
+ gint natural_height;
+
+ gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (bin->child),
+ view_allocation.width,
+ NULL,
+ &natural_height);
+ vadjustment->upper = MAX (natural_height, view_allocation.height);
+ }
+ else
+ {
+ GtkRequisition child_requisition;
+
+ gtk_widget_get_child_requisition (bin->child, &child_requisition);
+ vadjustment->upper = MAX (child_requisition.height, view_allocation.height);
+ }
}
else
vadjustment->upper = view_allocation.height;