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 308973 - Style property for background color of sorted treeview column is needed
Style property for background color of sorted treeview column is needed
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.6.x
Other Linux
: Normal normal
: Small API
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2005-06-24 21:43 UTC by Yevgen Muntyan
Modified: 2016-06-08 03:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Created a style property that allows users to prevent this functionality. (1.67 KB, patch)
2009-10-17 19:11 UTC, Patrick
none Details | Review

Description Yevgen Muntyan 2005-06-24 21:43:00 UTC
Distribution/Version: Debian

There should be a style property (or two - for odd and even cells) for sorted
column of a treeview, or maybe just a way to make sorted column have regular
appearance (or rather disable coloring by default, and provide a way to enable
different color for sorted column; coloring sorted column is a bit strange thing).
Currently sorted column always has different background - default GTK engine
uses "odd-row-color" for drawing background of sorted column; xfce engine greys
it too. So it's impossible to have ruled tree where sorted column doesn't have
special background.
Comment 1 Patrick 2009-10-17 18:33:45 UTC
I strongly second this (I'm using 2.16.6 on Windows). I'm trying to work around this currently but unfortunately haven't figured out a way to do it.

This functionality is definitely really weird, and I'll even go so far as to say it looks terrible if you've got the GtkTreeView::even-row-color style property set to something other than white.

The relevant code is in gtkstyle.c, around line 3716 (2.16.6 source). Basically the code takes *-row-color, darkens it, and uses it as the background color for the row in the sort column.

Interesting note: Pidgin's plugin window doesn't suffer from this issue, even though it has sorted columns. I later found out that this is because, apparently (see the changelog for GTK+ 2.3.3) unless there are three visible columns, the background color of the sort column won't be darkened.

Anyone know of a way I can work around this until there's an official fix? As far as a fix goes, I think the easiest thing would indeed be to add two style properties, one for the even sorted cell, another for the odd sorted cell.
Comment 2 Patrick 2009-10-17 19:11:38 UTC
Created attachment 145689 [details] [review]
Created a style property that allows users to prevent this functionality.

I attached a patch that adds a style property, "darken-sort-column-rows", set to TRUE by default (as it's currently the default functionality).

If set to FALSE, the functionality of darkening the rows in the sort column of a tree view will be disabled.

I think that's all that needs to be done to create a style property? Unable to test as I don't currently have the time to setup a dev environment to compile GTK on Windows.

It'd be super cool if this could make it into 2.16.7...
Comment 3 Matthias Clasen 2016-06-08 03:46:09 UTC
This didn't happen; and there's no poin tin keeping a bug open for this.