Bug 568512 - swt-selection-background-color on Tree not painting correctly
Summary: swt-selection-background-color on Tree not painting correctly
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.16   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: 2020-11-03 15:48 EST by Page CLA
Modified: 2020-11-03 15:51 EST (History)
0 users

See Also:


Attachments
image1.png: shows the paint issue (32.17 KB, image/png)
2020-11-03 15:48 EST, Page CLA
no flags Details
image2.png: shows no issue when swt-selection-background-color is not used. (32.94 KB, image/png)
2020-11-03 15:49 EST, Page CLA
no flags Details
The zip file contains the source code to demo the issue. (99.24 KB, application/octet-stream)
2020-11-03 15:51 EST, 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 2020-11-03 15:48:20 EST
Created attachment 284654 [details]
image1.png: shows the paint issue

I have a css defined for Tree :

Tree {
    color: #1e1e1e;
    background-color: #ffffff;
    swt-selection-background-color: #cde6eb;
    swt-selection-border-color:  #cde6eb;
    swt-selection-color: #1e1e1e;
    swt-hot-background-color: #daecf0;
    swt-hot-border-color: #daecf0;   
}

When the tree has a horizontal scrollbar, the selection background is only painted half way up-to where the scrollbar is (see attachment image1).

If I enlarge the view to display the complete tree node, the problem goes away.

If I remove "swt-selection-background-color" and "swt-selection-border-color" from css, the problem goes away. (see attachment image2)

The tree is create as following:

	public E4CustomOverview( Composite parent )
	{
		viewer = new TreeViewer( parent );
		viewer.setContentProvider( new TreeContentProvider() );
		viewer.getTree().setHeaderVisible( true );
		viewer.getTree().setLinesVisible( true );

		TreeViewerColumn viewerColumn = new TreeViewerColumn( viewer, SWT.NONE );
		viewerColumn.getColumn().setWidth( 300 );
		viewerColumn.getColumn().setText( "Objects" );
		viewerColumn.setLabelProvider( new MyLabelProvider() );
		GridLayoutFactory.fillDefaults().generateLayout( parent );

		viewer.setInput(new String[] { "Welcome to this funny node that doesn't paint correctly" });

	}

I have also attached the eclipse project which duplicates the issue.
Comment 1 Page CLA 2020-11-03 15:49:55 EST
Created attachment 284655 [details]
image2.png: shows no issue when swt-selection-background-color is not used.
Comment 2 Page CLA 2020-11-03 15:51:15 EST
Created attachment 284656 [details]
The zip file contains the source code to demo the issue.