Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Inherit CSS style - Shell and Composite(Problem with styling background color of composite)
Inherit CSS style - Shell and Composite [message #658369] Tue, 08 March 2011 08:57 Go to next message
derhaa is currently offline derhaaFriend
Messages: 6
Registered: February 2011
Junior Member
Ok, there is code snippet and theme.css is below. I want to set background-color of Composite as BLUE, but Shell's background-color wins. Why?

I use actual RAP v1.4 and develop application at actual RAP sources from repository (last update 2 hours ago).

public class ViewTest extends ViewPart {

    public static final String ID = "cz.ui.viewtest";
    
    @Override
    public void createPartControl(Composite parent) {
        parent.setLayout(GLF.gridLayout(1, 5, 5, 5, 5));
        Text txt = new Text(parent);
    }

    @Override
    public void setFocus() {
       //nothing
    }

}


Theme.css
* {
    color: black;
    font : 11px Arial, Helvetica, sans-serif;
    padding:0px;
    margin:0px;
    spacing:0px;
}
Display {
  rwt-shadow-color: #a7a6aa;
  rwt-highlight-color: #ffffff;
  rwt-darkshadow-color: #85878c;
  rwt-lightshadow-color: #dcdfe4;
  rwt-thinborder-color: #aca899;
  rwt-selectionmarker-color: #fec83c;
  rwt-infobackground-color: #ffffff;
}

Composite {
  padding: 0px;
  opacity: 1;
  background-color: blue;
  background-image: none;
  border: none;
}

Composite[BORDER] {
  background-color: blue;
  background-image: none;
}

Shell {
	border: 1px #808080;
	background-color: red;
	padding: 3px;
	opacity: 1;
	background-image: none;
	border-radius:0px;
}
 
Shell-Titlebar {
	background-color: #9DA7C3;
	background-gradient-color: #9DA7C3;
	background-image: gradient( linear, left top, left bottom,
	                            from( #0A246A ), to( #005092 ) );
	padding: 2px 5px 2px;
	margin: 0px;
	height: 22px;
	border: none;
	border-radius:0px;
	color: white;
	font : bold 11px Arial, Helvetica, sans-serif;
}




UPDATE:
When I set Composite's background-image. It works and all composites have image, but background color does not work.

[Updated on: Tue, 08 March 2011 09:25]

Report message to a moderator

Re: Inherit CSS style - Shell and Composite [message #658626 is a reply to message #658369] Wed, 09 March 2011 09:56 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi derhaa,
I've unable to reproduce what you described with current CVS HEAD.
Theming for Shell and Composite works fine for me. Which version of RAP
are you using? Could you provide a complete self-running project to test it?
Best,
Ivan

On 3/8/2011 10:57 AM, derhaa wrote:
> Ok, there is code snippet and theme.css is below. I want to set
> background-color of Composite as BLUE, but Shell's background-color
> wins. Why?
>
> public class ViewTest extends ViewPart {
>
> public static final String ID = "cz.ui.viewtest";
> @Override
> public void createPartControl(Composite parent) {
> parent.setLayout(GLF.gridLayout(1, 5, 5, 5, 5));
> Text txt = new Text(parent);
> }
>
> @Override
> public void setFocus() {
> //nothing
> }
>
> }
>
>
> Theme.css
>
> * {
> color: black;
> font : 11px Arial, Helvetica, sans-serif;
> padding:0px;
> margin:0px;
> spacing:0px;
> }
> Display {
> rwt-shadow-color: #a7a6aa;
> rwt-highlight-color: #ffffff;
> rwt-darkshadow-color: #85878c;
> rwt-lightshadow-color: #dcdfe4;
> rwt-thinborder-color: #aca899;
> rwt-selectionmarker-color: #fec83c;
> rwt-infobackground-color: #ffffff;
> }
>
> Composite {
> padding: 0px;
> opacity: 1;
> background-color: blue;
> background-image: none;
> border: none;
> }
>
> Composite[BORDER] {
> background-color: blue;
> background-image: none;
> }
>
> Shell {
> border: 1px #808080;
> background-color: red;
> padding: 3px;
> opacity: 1;
> background-image: none;
> border-radius:0px;
> }
>
> Shell-Titlebar {
> background-color: #9DA7C3;
> background-gradient-color: #9DA7C3;
> background-image: gradient( linear, left top, left bottom,
> from( #0A246A ), to( #005092 ) );
> padding: 2px 5px 2px;
> margin: 0px;
> height: 22px;
> border: none;
> border-radius:0px;
> color: white;
> font : bold 11px Arial, Helvetica, sans-serif;
> }
>
>
>
Previous Topic:Low Performance of Canvas in IE 8
Next Topic:rap war not runs on Tiny Java Web Server .
Goto Forum:
  


Current Time: Sat Oct 16 13:02:31 GMT 2021

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

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

Back to the top