Skip to main content



      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 18:04 Go to next message
Eclipse UserFriend
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] Thu, 06 September 2012 23:12 Go to previous messageGo to next message
Eclipse UserFriend
Seems like setting SWT.INHERIT_NONE on the parent composite does the trick. Thanks.

[Updated on: Thu, 06 September 2012 23:22] by Moderator

Re: Setting Composite Background color [message #909479 is a reply to message #909367] Fri, 07 September 2012 03:51 Go to previous messageGo to next message
Eclipse UserFriend
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 12:05 Go to previous message
Eclipse UserFriend
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: Wed Jul 16 04:52:27 EDT 2025

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

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

Back to the top