Bug 574434 - [win32] Owner-drawn TreeItem: selection background color is wrong
Summary: [win32] Owner-drawn TreeItem: selection background color is wrong
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.20   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: 2021-06-24 03:50 EDT by Thomas Wolf CLA
Modified: 2021-06-29 13:30 EDT (History)
0 users

See Also:


Attachments
SWT snippet demonstrating the issue (1.44 KB, application/octet-stream)
2021-06-24 03:50 EDT, Thomas Wolf CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.