Strange behavior on Tree element once CSS is applied. [message #1839555] |
Tue, 23 March 2021 16:09  |
Eclipse User |
|
|
|
I have a simple CSS for the tree and used for my tree.
#MyTree {
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.setData("org.eclipse.e4.ui.css.id","MyTree" );
tree.setLinesVisible( false );
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.
Wondering if anyone has any idea what might cause this issue?
Is there any code to change popup node colors?
If not, can I turn off the popup?
Thank you very much for the help!
|
|
|
Re: Strange behavior on Tree element once CSS is applied. [message #1839688 is a reply to message #1839555] |
Thu, 25 March 2021 14:38  |
Eclipse User |
|
|
|
Just FYI
The cause is due to the grid layout data used:
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;
viewer.getTree().setLayoutData(data);
If I remove "data.grabExcessHorizontalSpace = true", the problem goes away but of course there will be no popup upon mouse hove over.
|
|
|
Powered by
FUDForum. Page generated in 0.27910 seconds