Community
Participate
Working Groups
Created attachment 277511 [details] Overlay element foreground color issue (white on white background) When we specify the css properties for the tree Tree { swt-selection-foreground-color: white; swt-selection-background-color: black; } we can see that when the tree does not have enough space to render the TreeItem, the overlapping item that appears on mouse over displays the selection foreground, and not the tree foreground, ignoring the background. This means that in cases where the foreground is almost the same color as this overlay background we cannot read the text properly. In some cases it seems that this element takes the border color, others the selection foreground color. This is visible in eclipse's dark theme as in the attached screenshots. This seems to be introduced with the AbstractControlSelectionEraseListener (in this case extended by TreeControlSelectionEraseListener). One hacky workaround is to add two new listeners to the tree: - A listener with the type SWT.EraseItem that sets a foreground color. This foreground is then used for the selected items and the overlay that appears on mouse over. - A listener with the type SWT.PaintItem that paints over the text with the correct color in case of a selection. The foreground color of this overlaying element should be configurable, or the background should be painted with the same color as the treeItem. There is another strange rendering when the overlay is for the first visible item of the tree that has an arrow. In this case we can see the overlay being painted like the others, but then the treeItem is painted on top of that shifted to the right.
Created attachment 277512 [details] Overlay element foreground color issue (light blue on white background)
Created attachment 277513 [details] Overlay element foreground painted over with TreeItem
Any update on this? Just tested in Eclipse 2020-03 and the issue is still there.