From 015b3c5671ae257b284e3f6df53273f69b9916de Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Fri, 17 Jun 2005 19:44:53 +0000 Subject: [PATCH] Fix #160281, testcase from Peter Bloomfield. 2005-06-17 Kristian Rietveld Fix #160281, testcase from Peter Bloomfield. * gtk/gtktreeview.c (do_presize_handler): always size request and update adjustments in fixed height mode, (gtk_tree_view_build_tree): if a fixed height is set, set this height on newly added nodes. --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ gtk/gtktreeview.c | 20 ++++++++++++++++++++ 4 files changed, 47 insertions(+) diff --git a/ChangeLog b/ChangeLog index d76f221fcd..70de302199 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-06-17 Kristian Rietveld + + Fix #160281, testcase from Peter Bloomfield. + + * gtk/gtktreeview.c (do_presize_handler): always size request + and update adjustments in fixed height mode, + (gtk_tree_view_build_tree): if a fixed height is set, set this + height on newly added nodes. + 2005-06-17 Tor Lillqvist * gdk/win32/gdkdnd-win32.c (gdk_dropfiles_filter): Set the actions diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index d76f221fcd..70de302199 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +2005-06-17 Kristian Rietveld + + Fix #160281, testcase from Peter Bloomfield. + + * gtk/gtktreeview.c (do_presize_handler): always size request + and update adjustments in fixed height mode, + (gtk_tree_view_build_tree): if a fixed height is set, set this + height on newly added nodes. + 2005-06-17 Tor Lillqvist * gdk/win32/gdkdnd-win32.c (gdk_dropfiles_filter): Set the actions diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index d76f221fcd..70de302199 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +2005-06-17 Kristian Rietveld + + Fix #160281, testcase from Peter Bloomfield. + + * gtk/gtktreeview.c (do_presize_handler): always size request + and update adjustments in fixed height mode, + (gtk_tree_view_build_tree): if a fixed height is set, set this + height on newly added nodes. + 2005-06-17 Tor Lillqvist * gdk/win32/gdkdnd-win32.c (gdk_dropfiles_filter): Set the actions diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index b070dab997..0631a23043 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -5232,6 +5232,20 @@ do_presize_handler (GtkTreeView *tree_view) } validate_visible_area (tree_view); tree_view->priv->presize_handler_timer = 0; + + if (tree_view->priv->fixed_height_mode) + { + GtkRequisition requisition; + gint height_old = tree_view->priv->height; + + gtk_widget_size_request (GTK_WIDGET (tree_view), &requisition); + + tree_view->priv->hadjustment->upper = MAX (tree_view->priv->hadjustment->upper, (gfloat)requisition.width); + tree_view->priv->vadjustment->upper = MAX (tree_view->priv->vadjustment->upper, (gfloat)requisition.height); + gtk_adjustment_changed (tree_view->priv->hadjustment); + gtk_adjustment_changed (tree_view->priv->vadjustment); + gtk_widget_queue_resize (GTK_WIDGET (tree_view)); + } return FALSE; } @@ -7639,6 +7653,12 @@ gtk_tree_view_build_tree (GtkTreeView *tree_view, gtk_tree_model_ref_node (tree_view->priv->model, iter); temp = _gtk_rbtree_insert_after (tree, temp, 0, FALSE); + if (tree_view->priv->fixed_height > 0) + { + if (GTK_RBNODE_FLAG_SET (temp, GTK_RBNODE_INVALID)) + _gtk_rbtree_node_set_height (tree, temp, tree_view->priv->fixed_height); + } + if (is_list) continue;