Bug 566280 - [Win32][Dark theme] Table and Tree selection has different background color
Summary: [Win32][Dark theme] Table and Tree selection has different background color
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 normal with 2 votes (vote)
Target Milestone: 4.21 M3   Edit
Assignee: Rolf Theunissen CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
Depends on:
Blocks: 575417 574014
  Show dependency tree
 
Reported: 2020-08-22 10:43 EDT by Rolf Theunissen CLA
Modified: 2021-08-17 03:33 EDT (History)
3 users (show)

See Also:


Attachments
Without this change (35.29 KB, image/png)
2021-08-11 02:34 EDT, Lars Vogel CLA
no flags Details
With this change (38.86 KB, image/png)
2021-08-11 02:34 EDT, Lars Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Theunissen CLA 2020-08-22 10:43:20 EDT
In the dark theme on Windows. The active and hover selection in a Tree has a gray background color. The active and hover selection of a Tree have a kind of blue background.

These selections should have a consistent color.
Comment 1 Lars Vogel CLA 2021-03-02 06:32:08 EST
I think this is a SWT issue in the dark theme. 

Or can be configure the hover selection color for trees / tables?
Comment 2 Eclipse Genie CLA 2021-08-11 01:32:10 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/183880
Comment 3 Lars Vogel CLA 2021-08-11 02:34:40 EDT
Created attachment 286915 [details]
Without this change
Comment 4 Lars Vogel CLA 2021-08-11 02:34:56 EDT
Created attachment 286916 [details]
With this change
Comment 5 Lars Vogel CLA 2021-08-11 02:35:15 EDT
Looks way better to me, thank you Rolf. I suggest to merge.
Comment 6 Rolf Theunissen CLA 2021-08-11 05:05:21 EDT
This solves it for the content assistant, however, the issue remains for other tables, like the ones in forms.
Comment 7 Gayan Perera CLA 2021-08-11 14:56:19 EDT
Should we close this issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=574412 or should be keep it to further improve this, may be to see if we can add support for custom selection background on all 3 platforms ?
Comment 9 Rolf Theunissen CLA 2021-08-13 02:26:31 EDT
It seems that the Windows Explorer Darkmode does not have a selection configured, the blueish selection color is the same as when no theme is selected.
Therefore, in dark mode, the selection of the table should be custom drawn always.

One way to trigger that behavior is to add, to the table (e.g. when creating the handle):
   addListener(SWT.EraseItem, e -> {});

This triggers the custom draw, together with the previous patch, this draws the grayish selections. It feels to me as a hack though, is there anybody available to make this into high quality code?
Or should we trigger something like this from the SWT/UI CSS theme engine?
Comment 10 Rolf Theunissen CLA 2021-08-15 09:09:53 EDT
Created Bug 575417 as followup
Comment 11 Lars Vogel CLA 2021-08-17 03:33:04 EDT
Dark theme behaves way better on Windows now. Thanks.