Proper selection coloring in JFace Structured Viewers#3659
Proper selection coloring in JFace Structured Viewers#3659Christopher-Hermann wants to merge 2 commits intoeclipse-platform:masterfrom
Conversation
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerSelectionColorListener.java
Outdated
Show resolved
Hide resolved
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
|
@Christopher-Hermann please use descriptive title and PR description and also adapt the commit message. It is impossible to understand without looking at the code what is actually done here. Beside that, its always good to show before/after screenshot for visual changes. |
|
Added PR title & description. In the current state there are most probably some things left that needs to be cleaned up, tests are missing, etc. But in the first place I wanted to share the coding with @fedejeanne to get the fix running on all operating systems. |
db2a1ad to
d173442
Compare
|
@Christopher-Hermann thank you for retrying this! As agreed, I tested on Linux and I found some of the problems that were already mentioned in #1956, namely:
This situation is worse with the default values since it's then white over white for non-focused elements (
|
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerSelectionColorListener.java
Show resolved
Hide resolved
...ui.workbench/eclipseui/org/eclipse/ui/internal/themes/ColumnViewerSelectionColorFactory.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StructuredViewer.java
Show resolved
Hide resolved
There was a problem hiding this comment.
@Christopher-Hermann I now have some other odd behavior: I see half painted selections :-\
EDIT: I see the icons though, so that's good :-)
Here I changed the Viewer selection background (focused) from orange to green and Viewer selection background (no focus) to yellow and you can see that the selections still have a half-orange part, both the focused and the non-focused ones.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerSelectionColorListener.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerSelectionColorListener.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerSelectionColorListener.java
Outdated
Show resolved
Hide resolved
606ad8c to
29bf05a
Compare
29bf05a to
c2654d1
Compare
|
I tried a lot on a Linux VM and followed the Eclipse article where the I’ve implemented a fix/option that influences selection colors, but explicitly only for Windows and macOS, effectively skipping GTK. Any opinions? |
|
@Christopher-Hermann thank you for looking into it and for going into so much trouble for Linux too! I have to say my opinion is somewhat partial since I only develop on Eclipse on Linux in my own free time (we use Windows at work, where my colleagues periodically remind me about this very annoying issue). That being said: I'd be OK to compromise and skip this feature for Linux. Maybe @akurtakov / @jonahgraham / @iloveeclipse can chip in here since they work on Linux? @Christopher-Hermann in case your proposal is accepted and you deliver the functionality for Windows and Mac only, you would have to remove the new properties under
|




Resumption of #1690
Highlighting problem when using the dark theme on Windows eclipse-platform/eclipse.platform.swt#811
JFace viewer are using OS selection color to highlight the selected item. On some OS this is not accessible. In particular when the eclipse is used with dark theme and the OS is used with light theme, this can cause really bad UI/UX experience. With this change, the selection color can be changed via color preference in the settings of eclipse.
Example

Selection color on Windows Server in dark theme looks really bad:
Testing
On start up of eclipse, the selection colors in column viewers (table and tree viewer) should look like before.
On Windows, the dark theme should predefine the selection colors to fix the bad coloring on some Windows platforms.
In the preferences (Preferences > General > Appearance > Colors and Fonts), there are 4 new properties for the coloring of the viewer selection:
Changing these colors should affect the coloring of the selection in viewers. The coloring should immediately be applied as soon as the apply button is confirmed. The reset button should reset the coloring to the OS specific highlight coloring, expect for Windows dark theme, where the predefined colors should be restored.
OS Information
The fix is implemented for Windows and Mac only (no GTK).
On GTK the coloring via
SWT.EaraseItemis not working properly.Fixes:
eclipse-platform/eclipse.platform.swt#811
#1688
#1956
#2780
#3570
See:
#1690
#2793