GNOME Bugzilla – Bug 308973
Style property for background color of sorted treeview column is needed
Last modified: 2016-06-08 03:46:09 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.
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.
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...
This didn't happen; and there's no poin tin keeping a bug open for this.