Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Get styles from current theme CSS(How to get current theme CSS properties)
Get styles from current theme CSS [message #1137111] Mon, 14 October 2013 09:10 Go to next message
John Gymer is currently offline John GymerFriend
Messages: 279
Registered: November 2012
Location: UK
Senior Member
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 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
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 Go to previous message
John Gymer is currently offline John GymerFriend
Messages: 279
Registered: November 2012
Location: UK
Senior Member
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
Previous Topic:Zooming not working in 2.1.1
Next Topic:Deploying single sourced RAP/SWT application
Goto Forum:
  


Current Time: Fri Apr 19 23:43:33 GMT 2024

Powered by FUDForum. Page generated in 0.03335 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top