This applies the proper CSS child ordering semantics using GtkCssNode to GtkListBox. You can now use :first-child, :last-child, :nth-child(), and :last-nth-child() selectors.
For example, this allows styling row separators using CSS while ignoring the separator on the last row.
GtkListBoxRow { border-bottom: 1px solid @borders; } GtkListBoxRow:last-child { border-bottom: none; }
When the sort ordering of the listbox changes, we also update the CSS node ordering.
aa07c40 listbox: add support for :first-child, :last-child and others
gtk/gtklistbox.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
Upstream: git.gnome.org