Bug 574434

Summary: [win32] Owner-drawn TreeItem: selection background color is wrong
Product: [Eclipse Project] Platform Reporter: Thomas Wolf <twolf>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.20   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=574484
Whiteboard:
Attachments:
Description Flags
SWT snippet demonstrating the issue none

Description Thomas Wolf CLA 2021-06-24 03:50:33 EDT
Created attachment 286672 [details]
SWT snippet demonstrating the issue

See the attached modified Snippet220. It draws a rectangle with red borders and filled with the background color to the right of each tree item.

When active, the selected item is highlighted with a light blue background, but the rectangle is dark blue. When inactive, the selected item has a gray background, but the rectangle is drawn in a lighter shade of gray.

Using SWT org.eclipse.swt.win32.win32.x86_64_3.116.100.v20210602-2209.jar .
Comment 1 Thomas Wolf CLA 2021-06-24 06:29:44 EDT
The light blue for the active selection is RGB(204, 232, 255). The dark blue from event.gc.getBackground() is RGBA(0, 120, 215, 255). Alpha blending this with alpha 0.2 against white gives RGB(204, 228, 247), which is pretty close...
Comment 2 Thomas Wolf CLA 2021-06-29 13:30:48 EDT
Trying the same within Eclipse, I notice that this selected background color also remains the same dark blue in Eclipse's dark mode, even though there the selection color is a dark gray. Compare bug 574484.