Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Setting Composite Background color(Composite background mode and CSS)
Setting Composite Background color [message #909288] Thu, 06 September 2012 22:04 Go to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
Hi,

I got stuck trying to set the background color of a composite. This composite (Composite A) lives inside another composite (Composite B).

I have set the background mode of composite A and B to SWT.INHERIT_DEFAULT. Also, I have set the WidgetUtil.CUSTOM_VARIANT of Composite B to a special CSS style and it works fine. Now, I try to set Composite A with another CSS style by using the custom variant, but the desired background color never showed up.

With all the code above and a hard call "setBackground(Color)", I can set the color to the one I want. But with CSS and custom variant, I can't do the same thing.

Is there any material which explains more about the background mode? Or if you can think of anything that I can try to get around the problem?

Thanks.
Re: Setting Composite Background color [message #909367 is a reply to message #909288] Fri, 07 September 2012 03:12 Go to previous messageGo to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
Seems like setting SWT.INHERIT_NONE on the parent composite does the trick. Thanks.

[Updated on: Fri, 07 September 2012 03:22]

Report message to a moderator

Re: Setting Composite Background color [message #909479 is a reply to message #909367] Fri, 07 September 2012 07:51 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Ronald,

I've noticed that the default background color of Composites is
currently set to "transparent" in the default theme, making Composites
inherit their parent's bg color. I've opened a bug [1] for this issue.

I guess this is the same problem you noticed.

Regards, Ralf

[1] 389020: Transparent Composite background color in default theme
https://bugs.eclipse.org/bugs/show_bug.cgi?id=389020


--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Setting Composite Background color [message #909701 is a reply to message #909479] Fri, 07 September 2012 16:05 Go to previous message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
Thanks Ralf. I don't think I am affected by this bug but it's good to know. After setting the parent composite to SWT.INHERIT_NONE, I can set the color of the child composite to the color I defined in my CSS file.

Ronald
Previous Topic:Virtual tree viewer refresh bug
Next Topic:JFace ControlDecoration not consistent.
Goto Forum:
  


Current Time: Thu Apr 18 08:44:08 GMT 2024

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

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

Back to the top