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 719624 - [Regression] CSS specifying colors for ToggleButtons only works when there's a modal dialog on top
[Regression] CSS specifying colors for ToggleButtons only works when there's ...
Status: RESOLVED NOTABUG
Product: gtk+
Classification: Platform
Component: .General
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-12-01 06:39 UTC by Thierry Vignaud
Modified: 2013-12-02 06:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rendering when there's a modal dialog or when another window has the focus (23.92 KB, image/png)
2013-12-01 06:42 UTC, Thierry Vignaud
Details
rendering when the window has the focus: CSS colors are ignored (27.63 KB, image/png)
2013-12-01 06:43 UTC, Thierry Vignaud
Details

Description Thierry Vignaud 2013-12-01 06:39:08 UTC
Mageia's drakxtools were recently ported from gtk2 to gtk3
One of those tools is diskdrake, a disk partition manager.
It previously used a RC file to specify the GtkToggleButton colors but now uses a CSS file.
This works fine with most themes but the default Adwaita.

Application colors are OK with Gtk+3/Adwaita only when:
- there's a popup dialog over main window
- the focus is on another window
(when switching back to diskdrake window, it remains OK for 1s,
then Adwaita redraws it in gray)

Thus CSS colors are only enforced when there's a modal dialog on top (eg: the confirmation dialog on startup) whereas RC colors were always enforced

See 
https://ml.mageia.org/l/arc/dev/2013-09/msg00170/oxygen1.png
https://ml.mageia.org/l/arc/dev/2013-09/msg00170/oxygen2.png
(the names are misleading, it's actually adwait that's used)
Comment 1 Thierry Vignaud 2013-12-01 06:42:47 UTC
Created attachment 263224 [details]
rendering when there's a modal dialog or when another window has the focus
Comment 2 Thierry Vignaud 2013-12-01 06:43:13 UTC
Created attachment 263225 [details]
rendering when the window has the focus: CSS colors are ignored
Comment 3 Matthias Clasen 2013-12-01 17:41:08 UTC
Can you show us the css file that is used to set those colors, please ?
Comment 4 Thierry Vignaud 2013-12-01 19:44:42 UTC
Here it is: http://gitweb.mageia.org/software/drakx/plain/perl-install/share/themes-galaxy.css
(which works fine with eg: oxygen-gtk theme)

Here's the old RC file: http://gitweb.mageia.org/software/drakx/plain/perl-install/share/themes-galaxy.rc
Comment 5 Carlos Garnacho 2013-12-01 23:18:59 UTC
In the GTK+ CSS interpreter (and CSS in general), background-image takes precedence over background-color, so the gradients set by Adwaita on focused windows' buttons still takes precedence over your custom background-color, this doesn't happen on unfocused windows because no background-image is set for buttons there.

In your custom CSS, you need to set "background-image: none;" as well, so only your background-color is left to define the background.