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 746210 - GtkListBoxRow with GtkImage child: correctly update CSS on selection
GtkListBoxRow with GtkImage child: correctly update CSS on selection
Status: RESOLVED DUPLICATE of bug 763517
Product: gtk+
Classification: Platform
Component: Class: GtkStyleContext
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-03-14 14:53 UTC by Arnaud B.
Modified: 2017-08-24 21:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Arnaud B. 2015-03-14 14:53:28 UTC
It’s for a bug visible in Iagno (`iagno`) 3.15.90+, in the “Select theme” dialog that appears when you click “Appearance” in the app-menu. I think it’s a gtk+ bug, sorry if I missed something.

There’s a ListBox with inside each ListBoxRow a Label and an Image. When a ListBoxRow is selected, the :selected CSS state is updated (you could make the text of the Label change), but the "GtkListBoxRow:selected GtkImage" CSS isn’t applied. You have to hover the ListBoxRow for the image color/opacity to be updated.
Comment 1 Matthias Clasen 2015-03-14 15:14:44 UTC
Does your gtk have commit 9ec28047756256ad396ccb318e214e13dd034af0 ? That was included in 3.15.11
Comment 2 Arnaud B. 2015-03-14 15:23:06 UTC
Oh, I just discovered a thing… it works correctly on hicolor theme. I’m using HighContrast.

The bug exists on git master and Fedora 22 package with gtk+ 3.15.11.
Comment 3 Matthias Clasen 2015-03-14 18:54:37 UTC
What wasn't mentioned in the original description is that iagno uses custom css to 'hide' images and animated transitions.
Comment 4 Arnaud B. 2015-03-15 05:04:17 UTC
I’m sorry I didn’t make that clear for the beginning. Yes, I’m not tracking a theme bug, but a renderer bug: at one point, a correct CSS declaration does not correctly update the rendering of the window.

I found two fixes to Iagno’s bug. The first one is what I was looking for (after my second comment…): the declaration that makes the rendering update in hicolor theme, but not in HighContrast.

== Fix 1 ==

https://git.gnome.org/browse/iagno/commit/?id=75a21d5ba729c7937a12c8c01d77366ff9099af4

Adding a line:

#fake-example *:selected *:visited { opacity: 1; }

makes the rendering work correctly. Of course, I do not have any widget called “fake-example”; and “opacity:1” could be replaced by other things. What is important is that having a check on “*:selected *:visited” updates the rendering when something is selected, or that not having such a line do not update the rendering… The hicolor theme does not show the problem because it has a “*:selected *:link:visited” selection somewhere[1].

[1] currently, on https://git.gnome.org/browse/gtk+/tree/gtk/theme/Adwaita/gtk-contained.css#n1290

== Fix 2 ==

https://git.gnome.org/browse/iagno/commit/?id=0d1168d639441034fee424fb0b73f0dc0e17e28d

Changing the line:

GtkListBox#themes-listbox GtkListBoxRow:selected GtkImage {
by
GtkListBox#themes-listbox GtkListBoxRow:selected * {

correctly updates rendering on HighContrast theme (without needing the first fix). That’s the proof the “*” selector is doing many more things that just the minimum, but it’s probably a less important issue for now.
Comment 5 Arnaud B. 2015-09-04 17:40:49 UTC
The “fix 1” solved a similar problem in different conditions (other application, and other theme).

“another small question: I sometimes get weird rendering of my ListboxRows. But only after I click to activate them not when I iterate through them with keyboard short-cuts. And only with the elementary theme as far as I have tested (adwaita works). Is there something wrong in Gtk+ or maybe elementary theme, or could this bug be caused by my code? https://launchpadlibrarian.net/214922826/Screenshot%20from%202015-08-19%2000%3A11%3A06.png ” (on #gtk+, this day.)
Comment 6 Daniel Boles 2017-08-14 23:59:51 UTC
Possibly a dupe of https://bugzilla.gnome.org/show_bug.cgi?id=763517 which discusses various oddities with ListBox and CSS?
Comment 7 Daniel Boles 2017-08-24 21:40:48 UTC

*** This bug has been marked as a duplicate of bug 763517 ***