Community
Participate
Working Groups
Clients may wish to style their colours based on the OS's theme based on what's retrieved via SWT (SWT.COLOR_LIST_FOREGROUND, SWT.COLOR_LIST_BACKGROUND, etc etc). Based on CSS2ColorHelper's colorNamesMap field, I don't think this is currently supported.
Agree, this is great idea.
Typical use case is when you want to indicate the validation status on a widget. Suppose you define a CSS class that changes the text color to red. You add the class to the widget when an invalid value gets entered to it, and remove the CSS class when the widget is cleared/properly filled. The first surprising thing is that when you remove the CSS class the system default text color does not get restored, as you would expect based on your experiences how CSS works in a web browser. After some debugging and code reading you find out that if no matching CSS rules found for a widget it's properties are left alone completely. After this recognition the solution would be, you say, to also define a CSS class for the normal state! Correct. You create your CSS rule and quickly realize that there is nothing you could assign to the color property, if you would like to be platform aware. Text.valid { /* does not work unfortunately */ background-color: SWT.COLOR_LIST_BACKGROUND; color: SWT.COLOR_WIDGET_FOREGROUND; } Text.invalid { background-color: #f00; color: #fff; } SWT color constants should be available as e4 specific CSS colors.
See bug 402530 which was recently fixed PW
Great, thanks.
Looks to me that this bug is also fixed with Bug 402530? Anything left open here?
*** This bug has been marked as a duplicate of bug 402530 ***