Get styles from current theme CSS [message #1137111] |
Mon, 14 October 2013 09:10 |
|
In RAP, if I do not explicitly set colours of a widget, is there a reliable way to retrieve what the default style properties are? (prior to creating it)
For example, what is the default Button Background Colour, according to the active CSS theme?
I have found that I can use display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND) for some style properties, but not everything is available this way.
As another example, if I want to know the default background colour of a shell, how do I find that? There is no equivalent SWT.COLOR_WINDOW_BACKGROUND.
Thanks, John
---
Just because you can doesn't mean you should
|
|
|
Re: Get styles from current theme CSS [message #1137134 is a reply to message #1137111] |
Mon, 14 October 2013 09:30 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi John,
there is no API that provides such a functionality. Most of the widgets
have internal ThemeAdapters that read some of the CSS values from the
current theme. See ShellThemeAdapter class for example. But once
again... all these classes are internal and are subject to change
without any further notice.
Best,
Ivan
On 10/14/2013 12:10 PM, John Gymer wrote:
> In RAP, if I do not explicitly set colours of a widget, is there a
> reliable way to retrieve what the default style properties are? (prior
> to creating it)
> For example, what is the default Button Background Colour, according
> to the active CSS theme?
> I have found that I can use
> display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND) for some style
> properties, but not everything is available this way.
> As another example, if I want to know the default background colour of
> a shell, how do I find that? There is no equivalent
> SWT.COLOR_WINDOW_BACKGROUND.
> Thanks, John
>
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: Get styles from current theme CSS [message #1137140 is a reply to message #1137134] |
Mon, 14 October 2013 09:34 |
|
Thanks Ivan.
Perhaps when you have 'lots of spare time' (!) you could provide such an API?
It isn't high priority though, and I'm sure you've got more important things to do in the meantime.
Cheers, John
---
Just because you can doesn't mean you should
|
|
|
Powered by
FUDForum. Page generated in 0.03335 seconds