Bug 430205 - [CSS] Gradient background for Section is hard-coded
Summary: [CSS] Gradient background for Section is hard-coded
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 4.5 M5   Edit
Assignee: Simon Scholz CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatfix
Depends on:
Blocks: 430370 431635
  Show dependency tree
 
Reported: 2014-03-12 11:48 EDT by Andrea Guarinoni CLA
Modified: 2021-09-13 11:39 EDT (History)
3 users (show)

See Also:


Attachments
Result of trying to style Section et al. (77.13 KB, image/png)
2014-03-13 13:39 EDT, Timo Kinnunen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Guarinoni CLA 2014-03-12 11:48:46 EDT
The gradient/image used as background for the title of Section widget cannot be customized.

Changing the value of 'background', 'background-color', 'background-image' or 'swt-background-mode' have no effect on the top color of the gradient used as background.

According to org.eclipse.ui.forms.widgets.Section documentation this might be supported.
Comment 1 Daniel Rolka CLA 2014-03-13 03:22:27 EDT
Could you please attach any CSS snippet that shows the issue?

Daniel
Comment 2 Timo Kinnunen CLA 2014-03-13 13:39:17 EDT
Created attachment 240873 [details]
Result of trying to style Section et al.

Form > LayoutComposite Section,
Form > LayoutComposite Section > * {
background-color: #A9D #ED7 0% 100% false;
}
Form > LayoutComposite Section > LayoutComposite Text {
background-color: #A76 #49D 0% 100% false;
}
Comment 3 Lars Vogel CLA 2014-03-18 14:37:51 EDT
Section draws from the Background color to the color set by the setTitleBarBackground()

private void updateHeaderImage(Color bg, Rectangle bounds, int theight,
			int realtheight) {
		Image image = FormImages.getInstance().getGradient(getBackground(), bg, realtheight, theight, marginHeight, getDisplay());
		super.setBackgroundImage(image);
	}

I think we need a new CSSSelector to support setting the setTitleBarBackground() method via CSS.
Comment 4 Lars Vogel CLA 2014-03-18 17:21:28 EDT
I try to solve that together with Bug 430370.
Comment 5 Lars Vogel CLA 2014-03-18 17:24:51 EDT
https://git.eclipse.org/r/23565

To test, add the following to 

Section {
	swt-formtitlebackground:#FF0000;
}

to the e4-dark_partstyle.css file.
Comment 6 Lars Vogel CLA 2014-10-30 01:49:37 EDT
Simon, can you take over?
Comment 7 Simon Scholz CLA 2014-11-27 06:22:14 EST
See: https://git.eclipse.org/r/#/c/37145/

Now the title-bar-header will only be gradient, if the setTitleBarGradientBackground() method is used or by using the CSS background-color-gradient-titlebar property.
Comment 8 Lars Vogel CLA 2015-01-07 09:31:40 EST
Merged with https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=7728ea7d570e1ba4c0763d4dcc39e223219fcab0

Thanks Simon. This allows to set the gradient. It does not yet allow to set this via CSS, this is handled by Bug 430370.
Comment 9 Lars Vogel CLA 2015-01-07 09:31:59 EST
.
Comment 10 Lars Vogel CLA 2015-01-28 10:34:46 EST
Test in 4.5.0.I20150126-2000 and found one issue. Follow up in 458649.