GNOME Bugzilla – Bug 318163
Alternating row colors unstable
Last modified: 2014-08-03 20:51:10 UTC
When you're looking at a tree view with alternating row colors, and you insert a row above the visible area, the row colors shift, even though the row data stays put. This is confusing because it leads the eye to believe the rows are moving when actually they aren't, and it causes the whole area to be redrawn needlessly. Fortunately there's a conceptually pretty simple fix for this: Iff the added row is completely outside and above the visible area, switch the parity of the row colors for the entire tree, e.g. so that the first row becomes dark instead of light. This will make the row colors in the visible area appear stable. I've written a test case that I'm going to attach - it can be added to gtk+/tests/Makefile.am. It shows a tree view and appends + prepends a row every 1/4 of a second. I'll start looking into the problem itself now that I have a reliable test.
Created attachment 53150 [details] Test for GtkTreeView row/cell coloring.
Do you have the patch around? I'd like to integrate this soon.
Created attachment 64543 [details] [review] Draft patch. This patch maintains stable row colors on insertions and deletions. However, it does not handle reorders. It includes a test case which gets built in tests/.
Sorry for coming up with this so late. I missed the Bugzilla mail, and the patch was rotting on a broken-down laptop. The patch also addresses bug 129644, because it's related and seemed like a good idea at the time.
*** Bug 129644 has been marked as a duplicate of this bug. ***
Putting on my review list for 2.10 api freeze.
GtkTreeView::rules-hint has been deprecated