Bug 545239

Summary: TabbedPropertyList tabs don't update color as set in the CSS file until focus is gained
Product: [Eclipse Project] Platform Reporter: Phil Beauvoir <p.beauvoir>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: philippe.dul
Version: 4.10   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/160709
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=348af87b4875b9835552ff22e91e8cead44abfe9
Whiteboard:
Attachments:
Description Flags
Screenshot shows first edit part selected - correct
none
Screenshot shows second edit part selected - incorrect
none
Initial-color-is-gray none

Description Phil Beauvoir CLA 2019-03-09 13:17:57 EST
This affects a TabbedPropertySheetPage's tabs on the left side.

One can specify the colors used for these in the e4 CSS styling files in the "TabbedPropertyList" section

To see this problem more clearly set the value of swt-tabNormalShadow-color in the "e4_default_win.css" file to red "#ff0000;":

TabbedPropertyList {
   swt-tabAreaBackground-color : #ffffff;
   swt-tabBackground-color     : '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START';
   swt-tabNormalShadow-color   : #ff0000;  /* RED */
   swt-tabDarkShadow-color     : '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_SELECTED_TEXT_COLOR';
   color                       : #505050; 
}

In Eclipse or an RCP app that uses tabbed properties:

1. Ensure the Properties View is closed.
2. Select a View Part or Edit Part and show the Properties View. The Tabs are coloured as expected.
3. Select another View Part or Edit Part so that it updates the Properties View. The Tabs are NOT coloured as expected
4. Put the focus on the Properties View by clicking on it. The Tabs are coloured as expected.
Comment 1 Phil Beauvoir CLA 2019-03-09 13:19:01 EST
Created attachment 277813 [details]
Screenshot shows first edit part selected - correct
Comment 2 Phil Beauvoir CLA 2019-03-09 13:19:27 EST
Created attachment 277814 [details]
Screenshot shows second edit part selected - incorrect
Comment 3 Phil Beauvoir CLA 2019-03-09 13:21:42 EST
My theory is that TabbedPropertyList is rendering the tabs before TabbedPropertyList#setWidgetNormalShadowColor() has been called. But setting the focus on the Tabbed Property View corrects this.
Comment 4 Phil Beauvoir CLA 2019-03-10 07:47:44 EDT
A workaround is to call reskin() on TabbedPropertyComposite#getList() (TabbedPropertyList) after creating the controls in an AbstractPropertySection
Comment 5 Eclipse Genie CLA 2020-04-09 08:19:25 EDT
New Gerrit change created: https://git.eclipse.org/r/160709
Comment 6 Philippe Dul CLA 2020-04-09 08:51:50 EDT
Created attachment 282396 [details]
Initial-color-is-gray