After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 318163 - Alternating row colors unstable
Alternating row colors unstable
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
unspecified
Other Linux
: Normal enhancement
: Small API
Assigned To: Hans Petter Jansson
gtktreeview-bugs
: 129644 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-10-07 01:44 UTC by Hans Petter Jansson
Modified: 2014-08-03 20:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test for GtkTreeView row/cell coloring. (2.89 KB, text/x-csrc)
2005-10-07 01:47 UTC, Hans Petter Jansson
  Details
Draft patch. (12.16 KB, patch)
2006-04-30 01:29 UTC, Hans Petter Jansson
none Details | Review

Description Hans Petter Jansson 2005-10-07 01:44:29 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.
Comment 1 Hans Petter Jansson 2005-10-07 01:47:12 UTC
Created attachment 53150 [details]
Test for GtkTreeView row/cell coloring.
Comment 2 Federico Mena Quintero 2005-12-29 02:19:06 UTC
Do you have the patch around?  I'd like to integrate this soon.
Comment 3 Hans Petter Jansson 2006-04-30 01:29:12 UTC
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/.
Comment 4 Hans Petter Jansson 2006-04-30 01:32:58 UTC
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.
Comment 5 Kristian Rietveld 2006-05-27 22:51:32 UTC
*** Bug 129644 has been marked as a duplicate of this bug. ***
Comment 6 Kristian Rietveld 2006-05-27 22:52:40 UTC
Putting on my review list for 2.10 api freeze.
Comment 7 Matthias Clasen 2014-08-03 20:51:10 UTC
GtkTreeView::rules-hint has been deprecated