summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2006-01-14 19:41:07 +0000
committerKristian Rietveld <kristian@src.gnome.org>2006-01-14 19:41:07 +0000
commitf396a237dddcda8b85147f2bf4eb0fd8df994bc3 (patch)
treeec3b366983390d5c845aaf0955f96e6a4e39946e /gtk
parentfcfefedd44d9228220f73332b498b6f442247993 (diff)
downloadgtk+-f396a237dddcda8b85147f2bf4eb0fd8df994bc3.tar.gz
fixup adjustments and top_row if the current dy + page_size exceeds the
2006-01-14 Kristian Rietveld <kris@gtk.org> * gtk/gtktreeview.c (gtk_tree_view_size_allocate), (validate_visible_area): fixup adjustments and top_row if the current dy + page_size exceeds the new tree view height. (Fixes #316689, reported by Chris Lord).
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtktreeview.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index d9587bc281..afa17e54bd 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2129,6 +2129,9 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
/* now the adjustments and window sizes are in sync, we can sync toprow/dy again */
if (tree_view->priv->height <= tree_view->priv->vadjustment->page_size)
gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), 0);
+ else if (tree_view->priv->vadjustment->value + tree_view->priv->vadjustment->page_size > tree_view->priv->height)
+ gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment),
+ tree_view->priv->height - tree_view->priv->vadjustment->page_size);
else if (gtk_tree_row_reference_valid (tree_view->priv->top_row))
gtk_tree_view_top_row_to_dy (tree_view);
else
@@ -5067,6 +5070,11 @@ validate_visible_area (GtkTreeView *tree_view)
gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), 0);
gtk_tree_view_dy_to_top_row (tree_view);
}
+ else if (tree_view->priv->vadjustment->value + tree_view->priv->vadjustment->page_size > tree_view->priv->height)
+ {
+ gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), tree_view->priv->height - tree_view->priv->vadjustment->page_size);
+ gtk_tree_view_dy_to_top_row (tree_view);
+ }
else
gtk_tree_view_top_row_to_dy (tree_view);