Fixes #165034, reported by Jorn Baayen.

2005-07-08  Kristian Rietveld  <kris@gtk.org>

	Fixes #165034, reported by Jorn Baayen.

	* gtk/gtkrbtree.[ch] (_gtk_rbtree_set_fixed_height): add a
	mark_valid parameter (so we can mark all nodes as valid when we
	are setting them to the fixed height).

	* gtk/gtktreeview.c (initialized_fixed_height_mode): mark all
	nodes as valid when setting the fixed height,
	(do_validate_rows): update call to _set_fixed_height,
	(gtk_tree_view_row_inserted): mark node as valid when fixed
	height mode is enabled and a height has been set,
	(gtk_tree_view_build_tree): if fixed height mode is enabled,
	mark new nodes as valid in addition to setting the height.
This commit is contained in:
Kristian Rietveld 2005-07-08 19:17:10 +00:00 committed by Kristian Rietveld
parent 92da84155f
commit 7f5b9100ed
6 changed files with 70 additions and 9 deletions

View File

@ -1,3 +1,19 @@
2005-07-08 Kristian Rietveld <kris@gtk.org>
Fixes #165034, reported by Jorn Baayen.
* gtk/gtkrbtree.[ch] (_gtk_rbtree_set_fixed_height): add a
mark_valid parameter (so we can mark all nodes as valid when we
are setting them to the fixed height).
* gtk/gtktreeview.c (initialized_fixed_height_mode): mark all
nodes as valid when setting the fixed height,
(do_validate_rows): update call to _set_fixed_height,
(gtk_tree_view_row_inserted): mark node as valid when fixed
height mode is enabled and a height has been set,
(gtk_tree_view_build_tree): if fixed height mode is enabled,
mark new nodes as valid in addition to setting the height.
2005-07-08 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.2 ===

View File

@ -1,3 +1,19 @@
2005-07-08 Kristian Rietveld <kris@gtk.org>
Fixes #165034, reported by Jorn Baayen.
* gtk/gtkrbtree.[ch] (_gtk_rbtree_set_fixed_height): add a
mark_valid parameter (so we can mark all nodes as valid when we
are setting them to the fixed height).
* gtk/gtktreeview.c (initialized_fixed_height_mode): mark all
nodes as valid when setting the fixed height,
(do_validate_rows): update call to _set_fixed_height,
(gtk_tree_view_row_inserted): mark node as valid when fixed
height mode is enabled and a height has been set,
(gtk_tree_view_build_tree): if fixed height mode is enabled,
mark new nodes as valid in addition to setting the height.
2005-07-08 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.2 ===

View File

@ -1,3 +1,19 @@
2005-07-08 Kristian Rietveld <kris@gtk.org>
Fixes #165034, reported by Jorn Baayen.
* gtk/gtkrbtree.[ch] (_gtk_rbtree_set_fixed_height): add a
mark_valid parameter (so we can mark all nodes as valid when we
are setting them to the fixed height).
* gtk/gtktreeview.c (initialized_fixed_height_mode): mark all
nodes as valid when setting the fixed height,
(do_validate_rows): update call to _set_fixed_height,
(gtk_tree_view_row_inserted): mark node as valid when fixed
height mode is enabled and a height has been set,
(gtk_tree_view_build_tree): if fixed height mode is enabled,
mark new nodes as valid in addition to setting the height.
2005-07-08 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.2 ===

View File

@ -895,7 +895,8 @@ _gtk_rbtree_mark_invalid (GtkRBTree *tree)
void
_gtk_rbtree_set_fixed_height (GtkRBTree *tree,
gint height)
gint height,
gboolean mark_valid)
{
GtkRBNode *node;
@ -911,10 +912,14 @@ _gtk_rbtree_set_fixed_height (GtkRBTree *tree,
do
{
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_INVALID))
_gtk_rbtree_node_set_height (tree, node, height);
{
_gtk_rbtree_node_set_height (tree, node, height);
if (mark_valid)
_gtk_rbtree_node_mark_valid (tree, node);
}
if (node->children)
_gtk_rbtree_set_fixed_height (node->children, height);
_gtk_rbtree_set_fixed_height (node->children, height, mark_valid);
}
while ((node = _gtk_rbtree_next (tree, node)) != NULL);
}

View File

@ -142,7 +142,8 @@ void _gtk_rbtree_node_mark_valid (GtkRBTree *tree,
void _gtk_rbtree_column_invalid (GtkRBTree *tree);
void _gtk_rbtree_mark_invalid (GtkRBTree *tree);
void _gtk_rbtree_set_fixed_height (GtkRBTree *tree,
gint height);
gint height,
gboolean mark_valid);
gint _gtk_rbtree_node_find_offset (GtkRBTree *tree,
GtkRBNode *node);
gint _gtk_rbtree_node_find_parity (GtkRBTree *tree,

View File

@ -5088,7 +5088,7 @@ initialize_fixed_height_mode (GtkTreeView *tree_view)
}
_gtk_rbtree_set_fixed_height (tree_view->priv->tree,
tree_view->priv->fixed_height);
tree_view->priv->fixed_height, TRUE);
}
/* Our strategy for finding nodes to validate is a little convoluted. We find
@ -5206,7 +5206,7 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize)
if (!tree_view->priv->fixed_height_check)
{
if (fixed_height)
_gtk_rbtree_set_fixed_height (tree_view->priv->tree, prev_height);
_gtk_rbtree_set_fixed_height (tree_view->priv->tree, prev_height, FALSE);
tree_view->priv->fixed_height_check = 1;
}
@ -7309,11 +7309,15 @@ gtk_tree_view_row_inserted (GtkTreeModel *model,
{
tmpnode = _gtk_rbtree_find_count (tree, indices[depth - 1]);
_gtk_rbtree_insert_after (tree, tmpnode, height, FALSE);
}
}
done:
if (height > 0)
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
{
if (tree)
_gtk_rbtree_node_mark_valid (tree, tmpnode);
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
}
else
install_presize_handler (tree_view);
if (free_path)
@ -7703,7 +7707,10 @@ gtk_tree_view_build_tree (GtkTreeView *tree_view,
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);
{
_gtk_rbtree_node_set_height (tree, temp, tree_view->priv->fixed_height);
_gtk_rbtree_node_mark_valid (tree, temp);
}
}
if (is_list)