Bug 572313

Summary: Tree node doesn't display correctly upon mouse hove over
Product: [Eclipse Project] Platform Reporter: Page <pagew2000>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.20   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=566281
Whiteboard:
Attachments:
Description Flags
Screen shot to show the tree node display issue
none
The full eclipse project to demo the issue. none

Description Page CLA 2021-03-25 14:53:43 EDT
Created attachment 285951 [details]
Screen shot to show the tree node display issue

I have a simple CSS for the tree and used for my tree.

Tree {
    color: #ffffff;
    background-color:#003750;
    swt-hot-background-color: #2882ad;
    swt-hot-border-color: #2882ad;
    swt-selection-background-color: #cde6eb;
    swt-selection-border-color:  #cde6eb;
}

The tree is created as:
  Tree tree = new Tree( container, SWT.V_SCROLL | SWT.MULTI );
  tree.setLinesVisible( false );

  GridData data = new GridData();
  data.horizontalAlignment = GridData.FILL;
  data.verticalAlignment = GridData.FILL;
  data.grabExcessHorizontalSpace = true; // this line causes mouse hove over 
  text display issue.
  data.grabExcessVerticalSpace = true;

  tree.setLayoutData(data);


If the composite is not wide enough for displaying a long tree node, by default it should popup the node text and use the default color (background color white and node text black). However with my tree, the background for popup goes white, but the node text is also white (as CSS defined), thus user cannot see what's displayed.

I have uploaded an image to show the issue.

I found out if I remove "data.grabExcessHorizontalSpace = true", the problem goes away but of course there will be no popup upon mouse hove over.

It should use the default colors (white background with black text foreground) in this case. I don't see this problem with Table.

A full eclipse sample is also uploaded to demo the issue.
Comment 1 Page CLA 2021-03-25 14:55:59 EDT
Created attachment 285952 [details]
The full eclipse project to demo the issue.

Full eclipse project to demo the issue.

The css file: css/default.css
The tree code: src\org\eclipse\e4\ui\examples\css\rcp\E4CustomOverview.java