Theming: Only color focussed widget: Difficulties with GtkListBox and multiselect


I’d like to create a theme where only the currently focused element is highlighted. “Focused” here means "currently worked on by the user.


Current CSS

The CSS below got me almost all the way through

selection:focus          { background: lightblue; }
*:selected:focus         { background: lightblue; }
.view:focus > *:selected { background: lightblue; } /* Special treatment for treeview */

selection  { background: beige; }
*:selected { background: beige; }


The CSS above does not work as expected for GtkListBoxes that allow multiselection. In that case only one single row will be blue.


Source: gtk3-widget-factory, page 3, bottom left.


What CSS could I use to make selected rows of a GtkListBox blue iff one of the other rows has the technical focus (:focus)?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.