GNOME Bugzilla – Bug 733312
Deprecate GtkTreeView:rules-hint
Last modified: 2015-12-15 12:03:11 UTC
it's just not useful as an application-level API, if we defer it to a theme to honour what is a usability setting. application developers cannot design their own UI in a reasonable, reliable way if we let a theme disregard this - and our own default theme disregards it. plus, the main study on zebra striping has not shown conclusively that it helps, only that it does not hinder readability; and it did that on non-interactive tables.
Created attachment 280964 [details] [review] treeview: Deprecated rules-hint The rules-hint property has always been a fairly bad application API, as it set some wrong expectations for the developers; deferring to the theme makes it impossible to design application reliably, and if this is a usability setting we should either impose this setting on every theme, or simply drop it. Our own default theme does not honour the zebra striping, which makes this function even more questionable. In practice, usability studies on zebra striping have demonstrated that alternating colors on a list it improves readability just as much as clear ruling between rows, or by visually differentiating the selected row. Zebra striping improves readability (or, at least, it does not hinder it) on static displays, like a table on paper or a document; on a dynamic display, like an application's UI, there are different strategies that yield similar, if not better, results.
the links to the 2008 semi-formal study: http://alistapart.com/article/zebrastripingdoesithelp http://alistapart.com/article/zebrastripingmoredataforthecase
I have a wip style for our default theme (not commited yet), anyway, yeah I'm all for deprecation it
fine with me, too
Review of attachment 280964 [details] [review]: .
Attachment 280964 [details] pushed as 0ed766e - treeview: Deprecated rules-hint
What does this exactly mean, then? That it will be entirely the decision of the theme now?
(In reply to comment #7) > What does this exactly mean, then? That it will be entirely the decision of the > theme now? it *already* is a decision left entirely to the theme. it has always been the case since this API was introduced in GTK+ 2, actually. all that the :rules-hint property does is to tell the GtkTreeView to annotate each row CSS path with the 'even' or 'odd' regions. what happens afterwards is entirely and completely up to the theme. what deprecation means is that this API will be removed from GTK+ 4, whenever that happens.
(In reply to comment #8) > (In reply to comment #7) > > What does this exactly mean, then? That it will be entirely the decision of the > > theme now? > > it *already* is a decision left entirely to the theme. "entirely"? Well, not really, right?, because the theme would need to apply it only if gtk_tree_view_set_rules_hint is used (using the odd/even regions). > what deprecation means is that this API will be removed from GTK+ 4, whenever > that happens. Right, and then my real question is: if that API is gone now, the only way to have zebra-stripping style is to have a theme that decides to *always* apply the this style, to all gtkTreeViews, right? So now the decision is entirely left to the theme ("entirely" as opposed to "in combination" with the application). Or is it that odd/even regions are left as non-deprecated and if the widget doesn't want zebra stripping it should simply not mark these regions for the theme to use? Thanks
(In reply to comment #9) > (In reply to comment #8) > > (In reply to comment #7) > > > What does this exactly mean, then? That it will be entirely the decision of the > > > theme now? > > > > it *already* is a decision left entirely to the theme. > > "entirely"? Well, not really, right?, because the theme would need to apply it > only if gtk_tree_view_set_rules_hint is used (using the odd/even regions). that's inconsequential. it is, and has always been, entirely up to the theme to honor this property, so nobody using :rules-hint can actually *rely* on it being present, and there's no way for application to discover whether or not the theme has support for even/odd rules in the CSS and adopt countermeasures. it's like having a light switch in your house that may or may not turn on your light, assuming that somebody put a specific lamp in the room, and you cannot know that because the room is dark, and people may change the lamps in the room without you knowing. > > what deprecation means is that this API will be removed from GTK+ 4, whenever > > that happens. > > Right, and then my real question is: if that API is gone now but the API is not *gone* now: you can still use it, and hope for the best, just like it was before. once we release GTK+ 4 that API will not be there any more, but it may have been replaced by something else entirely, or we may have figured out something better. in reality, the end goal is to kill off the regions usage inside GTK+ as well, but for that we'll need better CSS support for non-GTK bits, like cell renderers. once we can drop the region usage, we should be able to tag rows with normal CSS selectors, and the theme authors may decide to use even/odd rules regardless of application API.
btw, are there any plans to deprecate tree-lines are is that gonna stay around for a while? In swt, we were using rules-hint. Since it is deprecated, I was thinking of changing it to tree-lines instead?
So this is deprecated, but there is currently no replacement for the functionality? Did I read that correctly? I see a lot of philosophy but no clear explanation of what not using this function entails. Other than that Adwaita ignored it anyway.
You should both ask on gtk-devel-list@gnome.org — Bugzilla is not a forum. (In reply to Leo Ufimtsev from comment #11) > btw, are there any plans to deprecate tree-lines are is that gonna stay > around for a while? "Tree lines"? (In reply to gnome from comment #12) > So this is deprecated, but there is currently no replacement for the > functionality? Did I read that correctly? Correct. The API is deprecated, and GtkTreeView does not emit regions for even/odd rows, as CSS regions are also a hack, and have been deprecated. New CSS attributes are being written that would make it possible to mark even/odd rows, but are currently not available. > I see a lot of philosophy but no clear explanation of what not using this function entails. The "philosophy" you see are usability studies which question the usefulness of the zebra striping. The explanation is in the commit message. Calling the set_rules_hint() method yields no result with any theme; the documentation was clear that the property is, and always was, just a hint, and that both GTK and themes are free to honour or ignore it at their leisure. Application developers should not rely on it actually doing anything.
Thank you, very clear. Really the documentation does not make this at all obvious, and neither does the commit message to be honest.