Community
Participate
Working Groups
A gradient can be set in the CSS style for the background-image property for, e.g. all the Buttons. On the widget instance (where the above mentioned CSS gradient applies), the background image property (an Image) can be set in java, too. The value set in Java should override the value set in CSS. Problem: In this case (gradient as background image), the value set in CSS always wins.
Created attachment 182738 [details] proposed patch for the Maintenance branch (similar for trunk) change the priority of gradient/image/solid in GraphicsMixin#_handleGfxBackground before: 1) gradient 2) image 3) solid after: 1) image 2) gradient 3) solid motivation: if we have a "confict": both image and gradient is set, then always the image should win, because the conflict can happen only when the gradient is set in CSS (it is not possible to set it in java) and the image in the API (it is not possible to set it in CSS if a gradient is already set). And if the same property is set in Java and CSS, java should win. -> image has a higher priority than the gradient
Applied patch (with minimal changes) and a new test to CVS HEAD. The priority is now image > gradient > color. Since only image OR gradient can be set by CSS, nothing changes there. Setting a gradient by Java-API is not supported, and setting a background-image will no overwrite a gradient in any case. However, setting a background-color by API on a widget with the css-property background-image set will still be ignored. This issue would be much more difficult to fix.