-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Highlighting problem when using the dark theme on Windows eclipse-platform/eclipse.platform.swt#811 #1690
Highlighting problem when using the dark theme on Windows eclipse-platform/eclipse.platform.swt#811 #1690
Conversation
including merge of PR eclipse-platform#1690
including merge of PR eclipse-platform#1690
including merge of PR eclipse-platform#1690
including merge of PR eclipse-platform#1690
including merge of PR eclipse-platform#1690
including merge of PR eclipse-platform#1690
including merge of PR eclipse-platform#1690
including merge of PR eclipse-platform#1690
including merge of PR eclipse-platform#1690
including merge of PR eclipse-platform#1690
@Christopher-Hermann thank you for looking into this! I personally use the dark theme and am sometimes annoyed that it doesn't highlight stuff properly (at least on Windows). I tested the viewer (on Windows 10) and I see this: I like it! Would it be possible to somehow also fix the auto-completion dialog though? Or maybe I am just testing this the wrong way? Here are the GIFs in raw format: gifs.zip |
I just looked into this exact issue today, see #1688. I hope I can finish the work on this the next weeks. |
fbe1bf5
to
0b528bf
Compare
Not sure about the design of TableOwnerDrawSupport and the sub class CompletionTableDrawSupport. Maybe someone has an better idea how to overwrite the selection color in CompletionTableDrawSupport. |
I don't know how the following could be achieved but my personal favorite would be:
IMO letting the users fix the coloring problem on their own by actively changing it would be good enough for this PR. My two cents on the issue :-) |
First of all, I really like and appreciate this contribution, as this dark theme highlighting problem on Windows is quite annoying. So thank you for working on that, @Christopher-Hermann! I have to admit that I had no time yet to look into the proposed solution, so I can only give input in terms of "solution-independent expectations". Maybe they can help you in some way; otherwise feel free to ignore them:
|
Yes, I also prefer this approach. I will have a look if something like this can be done within the preferences. I can imagine that taking the OS colors on the initial eclipse startup can also cause troubles when the OS color settings are changed in a later point in time. But I will have a look.
If the preference thing is not possible (or at least not with manageable effort) I will go for this approach to provide a quick fix at least for windows users. I think that's where the problem is most annoying. An then have a look on a separate PR. |
I achieved the desired behavior, at least for MacOS it's working fine:
It would be nice if someone can test the latest changes on other platforms. As soon as testing looks good I will have a look if unit tests can be added. |
294d1e3
to
9a6987b
Compare
@Christopher-Hermann could you please describe how you tested and what is the expected behavior? Please explain which menus/preferences should be changed in the "Testing" section of this PR for future reference. I can test in Linux if it's ready in the next couple of hours. Thank you. |
....eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionTableDrawSupport.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerSelectionColorListener.java
Outdated
Show resolved
Hide resolved
You can use the ZIP file provided under Testing here: #1690 (comment) Furthermore, the new selection color should be applied in all standard eclipse views using column viewer, for example project explorer, outline, etc. On Linux, the behavior should be:
|
@Christopher-Hermann thank you for the details. Changes look good in Linux and the colors can be changed. I also briefly tested in Windows and it looks OK. Please remember to:
The reason I insist on this is because it should be easy to see how to test and what to expect in which specific platform for newcomers. It would also give me and other reviewers an idea of how you tested and we could expand on that idea and test for stuff that you might have overlooked. My findingsI also found that, in Linux:
|
I noticed the same (not as bad as on Linux, but it could still be better) for MacOS. Maybe we need to define a color for the non focus selection. This shouldn't be affected by the OS highlight color anyway. |
Not related to this change, I opened another issue: #1878. You can assign the issue to me, I will look into it later. |
So should we simply rebase this PR and see if a new build is fine again? |
6099c27
to
10efcff
Compare
@BeckerWdf I just rebased, hopefully the error will be gone and the tests (in Mac) will run too |
Yes, rebasing is a good idea. |
5cf04c3
to
8783eb1
Compare
Rebase is not working. But the error is not reliable reproducible, sometime the Windows, sometime the Mac and sometime the Linux build is failing. |
failing test is unrelated and documented in #926 |
@fedejeanne: Are you ok with merging this PR? |
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. With this change, the selection color can be changed via color preference in the settings of eclipse. The colors are used to draw selection color for tree and table viewers. For Windows, the selection color in the dark theme is overwritten to fix the bad default coloring Fixes eclipse-platform/eclipse.platform.swt#811 Fixes eclipse-platform#1688
8783eb1
to
fb52307
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Christopher-Hermann for this, it looks really good!
I'm sorry for the delay, I'm swamped.
I took a final look into it and noticed that you exported some packages in org.eclipse.jface.text.tests
, which I assume was necessary because of Mockito? In any case, I removed the exports and the tests ran just fine on my machine so I tooked the liberty of pushing my changes into your PR so you don't need to wait for me again.
All checks pass so this one is ready to go ✅
Thank you again and thank you @BeckerWdf for your input too!
please have a look at test failures: #1955 |
And may this relate too? eclipse-platform/eclipse.platform.swt#1275 |
Are these tests not executed on the PR's verification build? |
I don't know. Sometimes the tests behave just different in Integration Builds or on OSs/java versions not tested on Ci. |
So if that's the case that's really sad. Once should have confidence that everything is ok if the verification builds are green. |
See #1955 (comment) for why this is broken. I.e., code should not assume any specific color key is registered if that plugin itself did not register that color key. I'm not sure if JFace is supposed to work standalone too, but in that case, you can't ever assume some color is registered if it's done via a plugin.xml. |
This caused #1956 regression too. |
Yes, it is. See https://wiki.eclipse.org/JFace#Using_JFace_outside_the_Eclipse_platform |
Is this still being worked on? Sad to see it was reverted due to side effects, rather than being improved. I've been looking for a fix for this, where the default highlighting in my setup is such that it is nearly impossible to tell when something is highlighted, as it is nearly the same color as the background. Edit: I'm also having the same problem with enabled toolbar buttons actually, eg. with the perspective toolbar I can't tell which perspective is selected, though this pull doesn't help with that... |
It's still on my TODOs list but unfortunately I don't really have time at the moment for this topic. |
That is too bad. In the mean time I have been trying to figure out where the toolbar button toggle highlighting is actually being done, though it seems that the highlighting is somewhere separate from the toolitems in org.eclipse.swt.widgets? |
Unless I am missing something, it looks like toolbar item highlighting is also entirely provided by the OS's implementation and theme coloring, and I did see there is an outstanding issue for windows 11 as well, in that regard; eclipse-platform/eclipse.platform.swt#217 (comment) |
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.
Fixes eclipse-platform/eclipse.platform.swt#811
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.
To test the in different kind of viewers, import project viewerSelectionDemo.zip and execute the command "Open Viewer Selection Demo". There a bunch of different viewers with different selection colors are rendered to test the coloring for focused/not focused viewers.
Open Questions/Issues
This will have impact on coloring for all eclipse installations on all OSs and themes. The default coloring of the OS is overwritten in any case, even if it is not needed. Maybe we should only overwrite the selection color if this is enabled/requested by the user via a preference setting?