Bug 328243 - oxygen-gtk3 doesn't respect colors specified in CSS by an application
Summary: oxygen-gtk3 doesn't respect colors specified in CSS by an application
Status: RESOLVED FIXED
Alias: None
Product: Oxygen
Classification: Plasma
Component: gtk3-engine (show other bugs)
Version: 1.2.0
Platform: Mageia RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL: https://bugs.mageia.org/show_bug.cgi?...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-30 09:55 UTC by tv
Modified: 2013-12-02 18:26 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
proposed patch (768 bytes, patch)
2013-11-30 18:22 UTC, Hugo Pereira Da Costa
Details
before (37.26 KB, image/png)
2013-12-01 06:01 UTC, tv
Details
after (40.99 KB, image/png)
2013-12-01 06:02 UTC, tv
Details
new patch (invalidates the previous one) (2.05 KB, patch)
2013-12-02 09:50 UTC, Hugo Pereira Da Costa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tv 2013-11-30 09:55:21 UTC
Diskdrake is a partition tool used by Mageia.
Up to know, it displayed togglebuttons with different colors according to the type of partions (vfat/ntfs, ext[2-4], xfs, ...)
It was recently ported to gtk+3, which unlikes gtk+1 & gtk+2, now uses CSS instead of RC files for theming.
Oxygen-gtk used the colors specified by the RC file.
However, unlike most other gtk+3 themes, Oxygen-gtk3 doesn't use the colors specified by the CSS file, but when there's a modal dialog on top of the main window (eg: the confirmation dialog on startup).

See also:
- the Mageia bug report: https://bugs.mageia.org/show_bug.cgi?id=11821
- the first catch in september:
  https://ml.mageia.org/l/arc/dev/2013-09/msg00170.html

Compare:
  https://ml.mageia.org/l/arc/dev/2013-09/msg00170/oxygen1.png
  https://ml.mageia.org/l/arc/dev/2013-09/msg00170/oxygen2.png

Reproducible: Always

Steps to Reproduce:
1. run diskdrake on Mageia 3
2. sees that colors appears on ToggleButtons (using gtk2/oxygen-gtk)
3. run diskdrake on Mageia 4 Cauldron 
4. sees that colors do NOT appear on ToggleButtons (using gtk3/oxygen-gtk3)
Actual Results:  
gray toggle buttons

Expected Results:  
colorized toggle buttons
Comment 1 Hugo Pereira Da Costa 2013-11-30 10:26:16 UTC
@thierry
Thanks for repoting here.
I'll fix the diskdrake bug asap
(possibly over the week end)
Comment 2 tv 2013-11-30 10:41:12 UTC
Thanks for your quick answer!
I guess you don't receive the mails from Mageia's bugzilla?
Comment 3 tv 2013-11-30 11:00:01 UTC
You may be interested in that bug list too:
https://bugs.mageia.org/buglist.cgi?cmdtype=runnamed&namedcmd=oxygen&list_id=17545
(needs to be logged in)

https://bugs.mageia.org/show_bug.cgi?id=11531 oxygen-gtk3 truncates emacs windows
https://bugs.mageia.org/show_bug.cgi?id=8848 Oxygen-gtk transparency problem
https://bugs.mageia.org/show_bug.cgi?id=10519 starting gtk applications issues two messages 'kde4-config: command not found' in console 
https://bugs.mageia.org/show_bug.cgi?id=9682 Text fields out of place when using oxygen-gtk with gnome 3 in the Tweak tool program
(...)

I've asked the reported to open bug reports here in the mean time
Comment 4 tv 2013-11-30 11:01:12 UTC
Note that #10519 has a patch at https://bugs.mageia.org/attachment.cgi?id=4138
Comment 5 Hugo Pereira Da Costa 2013-11-30 13:09:20 UTC
(In reply to comment #2)
> Thanks for your quick answer!
> I guess you don't receive the mails from Mageia's bugzilla?

Not all of them no. 
I revieve the one for which I am assigned.
And some forwarded by assignees
I did recieve the one on the diskdrake bug for instance.
Comment 6 Hugo Pereira Da Costa 2013-11-30 13:15:03 UTC
(In reply to comment #4)
> Note that #10519 has a patch at
> https://bugs.mageia.org/attachment.cgi?id=4138

This one is actually fixed, I think.
Need to double check if the fix has already been released though
(and the patch is invalid, for instance on windows)
Comment 7 Hugo Pereira Da Costa 2013-11-30 18:22:29 UTC
Created attachment 83844 [details]
proposed patch

Proposed patch
(not that there was an explicit TODO in the mentionned code).
Thierry ? Any chance you can test it, and possibly patch oxygen-gtk3 ?
Comment 8 Hugo Pereira Da Costa 2013-11-30 18:26:40 UTC
@Thierry
Note: 
sadly you can expect many issues with the current "stable" release of oxygen-gtk3 (and many compilations warnings actually)
Thing is: every new gtk3 release a lot of stuff get deprecated (especially in the styling)
(and deprecating for them usually means: it compiles, but does not work. So its basically broken)
Now I can fix them (and did so in master), but this have not been released, because the said changes in turn are not backward compatible, and latest oxygen-gtk3 becomes broken with earlier gtk3 versions (which many people still have around)
Bottom-line: I'm not sure how I will release these changes (likely a new minor version, like gtk3-1.3.0
To be honest, I find changing all the well working drak stuff to gtk3 after beta 1 quite a bold move :)
Comment 9 Hugo Pereira Da Costa 2013-11-30 18:31:29 UTC
(In reply to comment #0)
> Diskdrake is a partition tool used by Mageia.
> Up to know, it displayed togglebuttons with different colors according to
> the type of partions (vfat/ntfs, ext[2-4], xfs, ...)
> It was recently ported to gtk+3, which unlikes gtk+1 & gtk+2, now uses CSS
> instead of RC files for theming.
> Oxygen-gtk used the colors specified by the RC file.
> However, unlike most other gtk+3 themes, Oxygen-gtk3 doesn't use the colors
> specified by the CSS file, but when there's a modal dialog on top of the
> main window (eg: the confirmation dialog on startup).
> 
> See also:
> - the Mageia bug report: https://bugs.mageia.org/show_bug.cgi?id=11821
> - the first catch in september:
>   https://ml.mageia.org/l/arc/dev/2013-09/msg00170.html
> 
> Compare:
>   https://ml.mageia.org/l/arc/dev/2013-09/msg00170/oxygen1.png
>   https://ml.mageia.org/l/arc/dev/2013-09/msg00170/oxygen2.png

I'm confused: these screenshot are adwaita, not oxygen ...
Please ...



> Reproducible: Always
> 
> Steps to Reproduce:
> 1. run diskdrake on Mageia 3
> 2. sees that colors appears on ToggleButtons (using gtk2/oxygen-gtk)
> 3. run diskdrake on Mageia 4 Cauldron 
> 4. sees that colors do NOT appear on ToggleButtons (using gtk3/oxygen-gtk3)
> Actual Results:  
> gray toggle buttons
> 
> Expected Results:  
> colorized toggle buttons
Comment 10 tv 2013-12-01 06:01:21 UTC
Created attachment 83846 [details]
before
Comment 11 tv 2013-12-01 06:02:30 UTC
Created attachment 83847 [details]
after

This patch fixes it indeed!
Thanks
Comment 12 Hugo Pereira Da Costa 2013-12-02 08:22:05 UTC
... unfortunately, the patch is _not_ working.
Now all buttons get this crappy blue highlight on hover instead of the old shadow.
And disabling one without breaking diskdrake will not be easy ...
Comment 13 Hugo Pereira Da Costa 2013-12-02 09:35:34 UTC
Git commit 86b57d5ba483fce7767a7c3a271d2efdb0d3563e by Hugo Pereira Da Costa.
Committed on 02/12/2013 at 08:59.
Pushed by hpereiradacosta into branch 'gtk3'.

set default alpha channel when reading color from kde options
added diff operator to RGBA
use color provided by ThemingEngine for button background.

M  +1    -0    src/oxygenrgba.cpp
M  +10   -0    src/oxygenrgba.h
M  +7    -2    src/oxygenthemingengine.cpp

http://commits.kde.org/oxygen-gtk/86b57d5ba483fce7767a7c3a271d2efdb0d3563e
Comment 14 Hugo Pereira Da Costa 2013-12-02 09:35:39 UTC
Git commit 65893079b9faa0e78f9c699d23b89b3c0b7f4096 by Hugo Pereira Da Costa.
Committed on 02/12/2013 at 08:59.
Pushed by hpereiradacosta into branch 'gtk3-1.2'.

set default alpha channel when reading color from kde options
added diff operator to RGBA
use color provided by ThemingEngine for button background.

M  +1    -0    src/oxygenrgba.cpp
M  +10   -0    src/oxygenrgba.h
M  +7    -2    src/oxygenthemingengine.cpp

http://commits.kde.org/oxygen-gtk/65893079b9faa0e78f9c699d23b89b3c0b7f4096
Comment 15 Hugo Pereira Da Costa 2013-12-02 09:50:27 UTC
Created attachment 83873 [details]
new patch (invalidates the previous one)
Comment 16 tv 2013-12-02 10:31:02 UTC
This patch works equally well
BTW I altered CSS for Adwaita (which only displayed the colors when window was not focused):
http://gitweb.mageia.org/software/drakx/commit/perl-install/share?id=038fd7ccc8c37fba4225cd86ab9ab285528ef8c7
Comment 17 Hugo Pereira Da Costa 2013-12-02 11:35:11 UTC
Now, I'm still not so happy with this (hacky) patch and am still trying to work out a better solution
Comment 18 Hugo Pereira Da Costa 2013-12-02 16:36:10 UTC
ok. I have a fix of which I am happy here and will push after some more testing.
In any case, closing this bug report
Comment 19 tv 2013-12-02 16:40:32 UTC
Care to share it so that I update our oxygen-gtk3 package?
Comment 20 Hugo Pereira Da Costa 2013-12-02 18:26:38 UTC
@Thierry
I'll make a new release in less than a week, promise (that is: before this friday).
In the meanwhile, since the (somewhat hacky) patch above works, I'd rather test the current code myself and provide better crafted code by then
(I am now running cauldron, so testing should not be an issue)