Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Strange behavior on Tree element once CSS is applied.(Tree element not painted correctly at mouse hove over )
Strange behavior on Tree element once CSS is applied. [message #1839555] Tue, 23 March 2021 20:09 Go to next message
Page Mising name is currently offline Page Mising nameFriend
Messages: 31
Registered: July 2009
Member
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 18:38 Go to previous message
Page Mising name is currently offline Page Mising nameFriend
Messages: 31
Registered: July 2009
Member
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.

Previous Topic:read-only checkbox Button not displaying correctly
Next Topic:CTabFolder/CTabItems flashing on focus change
Goto Forum:
  


Current Time: Fri Apr 19 23:56:41 GMT 2024

Powered by FUDForum. Page generated in 0.02816 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top