Bug 572313 - Tree node doesn't display correctly upon mouse hove over
Summary: Tree node doesn't display correctly upon mouse hove over
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.20   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-25 14:53 EDT by Page CLA
Modified: 2021-06-08 11:06 EDT (History)
0 users

See Also:


Attachments
Screen shot to show the tree node display issue (68.64 KB, image/png)
2021-03-25 14:53 EDT, Page CLA
no flags Details
The full eclipse project to demo the issue. (99.36 KB, application/octet-stream)
2021-03-25 14:55 EDT, Page CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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