GNOME Bugzilla – Bug 732050
Add first-child/last-child support to GtkListBox
Last modified: 2015-05-30 03:05:40 UTC
This is needed to do more of the row styling (such as separators) with css.
yep, very needed
Created attachment 304295 [details] [review] add support for :first-child :last-child :nth-child() and :nth-last-child() This is a fairly hacky first attempt at implementing this. It works, but clearly can be done with less code and possibly more readable fashion.
Created attachment 304296 [details] [review] make patch more succinct Makes things a bit more succinct. Still not sure why I have to call the invalidate to make the first row apply immediately.
Created attachment 304297 [details] [review] add support for :first-child :last-child :nth-child() and :nth-last-child() It looks like we can remove the invalidate call too. Not sure why this wasn't working before, but appears to be working now.
I'm actually wrong on the above. Using my test program, changing the sort ordering can cause the first row's style to not update until it has been hovered. But I think that might be caused by a bug somewhere else in the CSS machinery.
This is fixed in master. We do still need to track down the invalidation, but it appears to be related to other areas of GtkCssNode.