Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » background-color and background-image
background-color and background-image [message #1412455] Tue, 26 August 2014 07:53 Go to next message
Kris Slowinski is currently offline Kris SlowinskiFriend
Messages: 18
Registered: August 2011
Junior Member
Is it possible to apply both background-color and background-image using CSS? I am trying with the following example and all I can get is either the correct background or the image repeated many times within the window with the black background:
Shell {
  background-color: gradient linear rgb(0,206,209) rgb(0,255,127);
  background-image: url('./image.png');
}

Additionally, I would like to have the image appear once in the upper-right corner of the screen.
Re: background-color and background-image [message #1412601 is a reply to message #1412455] Tue, 26 August 2014 15:05 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 877
Registered: January 2012
Senior Member

The background colour is being applied but the image takes priority. If you write some code that calls getBackground(), you'll obtain your colour.

SWT's Control#setBackgroundImage() only supports repeated (tiled) images. You could modify the CSS engine's implementation to simulate no-repeat, similar to how we implement the CSS gradients. When a gradient is specified, we generate a background image and install a ControlListener on the widget to regenerate and re-install the gradient image on resize (see GradientBackgroundListener#handle()). You'd need to modify AbstractCSSPropertyBackgroundCompositeHandler and CSSPropertyBackgroundSWTHandler to add similar support.

Brian.
Previous Topic:Window without maximize minimize and close
Next Topic:correct place for I18N classes
Goto Forum:
  


Current Time: Wed Jan 27 08:33:06 GMT 2021

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

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

Back to the top