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 732050 - Add first-child/last-child support to GtkListBox
Add first-child/last-child support to GtkListBox
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 731911 739774
 
 
Reported: 2014-06-22 16:25 UTC by Matthias Clasen
Modified: 2015-05-30 03:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add support for :first-child :last-child :nth-child() and :nth-last-child() (3.19 KB, patch)
2015-05-30 02:38 UTC, Christian Hergert
none Details | Review
make patch more succinct (2.51 KB, patch)
2015-05-30 02:47 UTC, Christian Hergert
none Details | Review
add support for :first-child :last-child :nth-child() and :nth-last-child() (2.41 KB, patch)
2015-05-30 02:54 UTC, Christian Hergert
committed Details | Review

Description Matthias Clasen 2014-06-22 16:25:55 UTC
This is needed to do more of the row styling (such as separators) with css.
Comment 1 Lapo Calamandrei 2014-08-21 13:34:55 UTC
yep, very needed
Comment 2 Christian Hergert 2015-05-30 02:38:51 UTC
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.
Comment 3 Christian Hergert 2015-05-30 02:47:50 UTC
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.
Comment 4 Christian Hergert 2015-05-30 02:54:13 UTC
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.
Comment 5 Christian Hergert 2015-05-30 02:58:24 UTC
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.
Comment 6 Christian Hergert 2015-05-30 03:05:40 UTC
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.