treeview: Add _gtk_rbtree_node_get_index()

.. as a replacement for _gtk_rbtree_node_find_parity(). Instead of 1 or
0, the function now returns the index of node in the complete tree
(counting from the root). And this is of course identical to the row
number.
This commit is contained in:
Benjamin Otte
2011-11-12 05:15:53 +01:00
parent b8dec90f3a
commit a890a61253
3 changed files with 8 additions and 8 deletions

View File

@ -4821,7 +4821,7 @@ gtk_tree_view_bin_draw (GtkWidget *widget,
* order, drawing each successive node.
*/
parity = !_gtk_rbtree_node_find_parity (tree, node);
parity = !(_gtk_rbtree_node_get_index (tree, node) % 2);
do
{
@ -14558,7 +14558,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view,
{
GtkRegionFlags row_flags;
if (_gtk_rbtree_node_find_parity (tree, node))
if ((_gtk_rbtree_node_get_index (tree, node) % 2))
row_flags = GTK_REGION_ODD;
else
row_flags = GTK_REGION_EVEN;