You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Highlighting problem when using the dark theme on Windows. #811
Describe the bug
Highlighting problem when clicking between the left tree view and the right page in the Eclipse preference pages when using the dark theme.
To Reproduce
When using the Eclipse preferences dialog with the dark theme, the current preference in the left tree selection pane is not visible as soon as an item is selected in the right hand side preferences pane (problem-1). If I click back on the left tree selection item for the current preference page, then the selection of the current setting in the right hand window is no longer visible(problem-2). I will attach a screen shot of both problems. This does not happen with the Eclipse Classic theme and you can use that theme to see how things should work.
Expected behavior
I expect the left tree to always highlight the node when working on the right hand pane. I expect the current item in the right hand pane to remain highlighted when I click back on the node in the left tree.
Screenshots
Problem-1: You cannot notice that the current item in the tree is 'Keys'
Problem-2: You cannot notice that the current key settings in the right is Add Attribute to XML (or it is barely noticeable)
Environment:
Select the platform(s) on which the behavior is seen:
All OS
Windows
Linux
macOS
Additional OS info (e.g. OS version, Linux Desktop, etc)
Windows 10
JRE/JDK version
JDK 17 Version since
Eclipse 2023-09 (noticed in Eclipse 2023-03)
Workaround (or) Additional context
This problem also happens between the Enterprise Explorer and the editor tabs in the Java EE Perspective.
Hi @Phillipus I opened it here because another issue which was fixed by a commit that you pointed out to me was fixed by correcting some code in this repository. I suspect that this might be the same problem again but I am not the expert here by any stretch. What should I do, create one also in eclipse-platform, transfer it to eclipse-platform or leave it here? BTW I presume that by "transfer" you mean recreate in other repo and close in this one?
@marioja It might be an issue with one of the dark theme CSS files here. I suspect that might be the case rather than being SWT. Let's see if anyone else knows.
Should I create a similar issue in eclipse.platform.ui repo also? I know you guys are just volunteers like me and you work on this in your free time but since I am a newbie I want to make sure that I have done the correct thing so that the correct volunteer can work on it in their free time. If I knew how to test this I would love to try to debug this myself but I am not certain how to do this. If someone had 15 minutes to point me in the right direction I might be able to look at this myself.
@marioja I experimented with the CSS theme files in eclipse\plugins\org.eclipse.ui.themes_1.2.2200.v20230220-0932\css. I added the folllowing to the e4-dark_win.css file:
ShellTree {
color:#CCC;
}
With this the unfocussed selected Preferences tree text is whiter than the other tree nodes. Perhaps a clue there?
@Phillipus I tried to test this myself by modifying the same in my .p2 folder: C:\Users\Public.p2\pool\plugins\org.eclipse.ui.themes_1.2.2200.v20230220-0932\css\e4-dark_win.css
I restarted eclipse and I did not see any change. Am I missing something?
Unfortunately, I'm not able to reproduce the error. I'm running on MacOS where everything works like expected. When I install eclipse on my VM, the preferences looks like this:
Do you have any special settings? For example, your scrollbar is painted a dark color while my scrollbar is gray.
@Christopher-Hermann Good day, thank you for chiming in. This problem is on Windows 10 as indicated in the original post on this issue. Do you have access to Windows 10? Windows 11 may work differently, I have not tested. As I said before, if someone can help me I could help work/test/fix this problem.
Sorry guys, Eclipse 2023-12 is out and this is still not fixed. Can anyone look into this? I always use dark them and it makes it really hard for my eyes to relate trees to selections. If someone could help me troubleshoot this on windows I am willing to help. I have no knowledge of the code base and I cannot do anything on my own. Ping me at mfj (at) earthling.net and we can connect.
As far as I understand the SWT tree control is drawing the selection via the OS. So the OS theme decides about the color of the selection.
For example when I change my windows to high contrast mode, we can see that the selection color in the theme matches the selection color in eclipse:
Since I only have access to a virtual Windows Server machine with limited configuration possibilities, I cannot manipulate the OS theme. @marioja Maybe you can try to configure your highlight color on your local Windows machine and confirm that this color is used for the selection in eclipse. Here is a description how this can be done: https://learn.microsoft.com/en-us/answers/questions/1193134/how-to-change-the-highlight-color-of-a-selected-de
This would at least help to really understand the issue.
I uploaded a commit where I do overwrite the default selection color with custom defined colors in eclipse, see Christopher-Hermann/eclipse.platform.ui@731c5ac
This solution works, but I'm not sure if this is a good solution:
The color of the OS theme is overwritten, I'm not sure if this ok for other themes like high contrast
The color of the selected item is drawn with a custom method, I'm afraid that this is not a good idea
Maybe someone can comment about my concerns. Currently I don't see a better solution for this issue.
I will do the test and report back. It would be nice if eclipse could respect the os current color scheme. I am running windows in dark mode and eclipse will use the white mode unless I switch to using the dark theme. On to testing...
ok, testing result. Unfortunately, with Windows 10 it is never simple. When you set windows to use dark mode so go to settings/colors and you select the Dark under choose your color. Unfortunately, this does not provide you with an option to select different colors for different components such as Selected text. This is only available when using the high contrast mode and when I select that, indeed Eclipse will use the Selected text color in the tree portion. But that is not an option since this problem is related to use case when one is not using high contrast mode. I will try to use your commit. @Christopher-Hermann How do I do this?
I personally think that your solution for respecting the eclipse dark theme colors in Windows by overriding how the selected text is written is perfectly acceptable. The current implementation of dark theme in Windows at least is totally based independent of the Windows dark mode settings and it should be. A developer should be able to use eclipse dark mode without having to switch to Windows dark mode or even if they switched.
One feature in the future could be that if you are running eclipse in a Windows using Light color then eclipse switches to Light theme and if you are using Windows in Dark color then eclipse switches to Dark theme. This again does not mean it would have to use the windows selected text color, it could still override it but just switches the theme based on the windows color.
There is still the possibility to have Eclipse use the windows theme colors to set the eclipse theme but that is something else and if we have control over eclipse themes and it works in either windows colors then there is no incentive IMHO.
Activity
Phillipus commentedon Sep 20, 2023
If this is theme related you might want to report or transfer the issue here - https://github.com/eclipse-platform/eclipse.platform.ui/issues
marioja commentedon Sep 21, 2023
Hi @Phillipus I opened it here because another issue which was fixed by a commit that you pointed out to me was fixed by correcting some code in this repository. I suspect that this might be the same problem again but I am not the expert here by any stretch. What should I do, create one also in eclipse-platform, transfer it to eclipse-platform or leave it here? BTW I presume that by "transfer" you mean recreate in other repo and close in this one?
Phillipus commentedon Sep 21, 2023
@marioja It might be an issue with one of the dark theme CSS files here. I suspect that might be the case rather than being SWT. Let's see if anyone else knows.
marioja commentedon Sep 21, 2023
@Christopher-Hermann if you have time could you have a look at this problem. I apologize if I am breaking etiquette by tagging you.
marioja commentedon Sep 22, 2023
Should I create a similar issue in eclipse.platform.ui repo also? I know you guys are just volunteers like me and you work on this in your free time but since I am a newbie I want to make sure that I have done the correct thing so that the correct volunteer can work on it in their free time. If I knew how to test this I would love to try to debug this myself but I am not certain how to do this. If someone had 15 minutes to point me in the right direction I might be able to look at this myself.
Phillipus commentedon Sep 26, 2023
@marioja I experimented with the CSS theme files in
eclipse\plugins\org.eclipse.ui.themes_1.2.2200.v20230220-0932\css. I added the folllowing to thee4-dark_win.cssfile:With this the unfocussed selected Preferences tree text is whiter than the other tree nodes. Perhaps a clue there?
marioja commentedon Sep 29, 2023
@Phillipus I tried to test this myself by modifying the same in my .p2 folder: C:\Users\Public.p2\pool\plugins\org.eclipse.ui.themes_1.2.2200.v20230220-0932\css\e4-dark_win.css
I restarted eclipse and I did not see any change. Am I missing something?
Christopher-Hermann commentedon Oct 4, 2023
Unfortunately, I'm not able to reproduce the error. I'm running on MacOS where everything works like expected. When I install eclipse on my VM, the preferences looks like this:

Do you have any special settings? For example, your scrollbar is painted a dark color while my scrollbar is gray.
marioja commentedon Oct 4, 2023
@Christopher-Hermann Good day, thank you for chiming in. This problem is on Windows 10 as indicated in the original post on this issue. Do you have access to Windows 10? Windows 11 may work differently, I have not tested. As I said before, if someone can help me I could help work/test/fix this problem.
marioja commentedon Dec 6, 2023
Sorry guys, Eclipse 2023-12 is out and this is still not fixed. Can anyone look into this? I always use dark them and it makes it really hard for my eyes to relate trees to selections. If someone could help me troubleshoot this on windows I am willing to help. I have no knowledge of the code base and I cannot do anything on my own. Ping me at mfj (at) earthling.net and we can connect.
Highlighting problem when using the dark theme on Windows eclipse-pla…
Christopher-Hermann commentedon Dec 7, 2023
As far as I understand the SWT tree control is drawing the selection via the OS. So the OS theme decides about the color of the selection.
For example when I change my windows to high contrast mode, we can see that the selection color in the theme matches the selection color in eclipse:

Since I only have access to a virtual Windows Server machine with limited configuration possibilities, I cannot manipulate the OS theme. @marioja Maybe you can try to configure your highlight color on your local Windows machine and confirm that this color is used for the selection in eclipse. Here is a description how this can be done: https://learn.microsoft.com/en-us/answers/questions/1193134/how-to-change-the-highlight-color-of-a-selected-de
This would at least help to really understand the issue.
I uploaded a commit where I do overwrite the default selection color with custom defined colors in eclipse, see Christopher-Hermann/eclipse.platform.ui@731c5ac
This solution works, but I'm not sure if this is a good solution:
Maybe someone can comment about my concerns. Currently I don't see a better solution for this issue.
marioja commentedon Dec 7, 2023
I will do the test and report back. It would be nice if eclipse could respect the os current color scheme. I am running windows in dark mode and eclipse will use the white mode unless I switch to using the dark theme. On to testing...
marioja commentedon Dec 8, 2023
ok, testing result. Unfortunately, with Windows 10 it is never simple. When you set windows to use dark mode so go to settings/colors and you select the Dark under choose your color. Unfortunately, this does not provide you with an option to select different colors for different components such as Selected text. This is only available when using the high contrast mode and when I select that, indeed Eclipse will use the Selected text color in the tree portion. But that is not an option since this problem is related to use case when one is not using high contrast mode. I will try to use your commit. @Christopher-Hermann How do I do this?
marioja commentedon Dec 8, 2023
I personally think that your solution for respecting the eclipse dark theme colors in Windows by overriding how the selected text is written is perfectly acceptable. The current implementation of dark theme in Windows at least is totally based independent of the Windows dark mode settings and it should be. A developer should be able to use eclipse dark mode without having to switch to Windows dark mode or even if they switched.
One feature in the future could be that if you are running eclipse in a Windows using Light color then eclipse switches to Light theme and if you are using Windows in Dark color then eclipse switches to Dark theme. This again does not mean it would have to use the windows selected text color, it could still override it but just switches the theme based on the windows color.
There is still the possibility to have Eclipse use the windows theme colors to set the eclipse theme but that is something else and if we have control over eclipse themes and it works in either windows colors then there is no incentive IMHO.
30 remaining items
Highlighting problem when using the dark theme on Windows eclipse-pla…
Highlighting problem when using the dark theme on Windows eclipse-pla…
Highlighting problem when using the dark theme on Windows eclipse-pla…
Highlighting problem when using the dark theme on Windows eclipse-pla…
Highlighting problem when using the dark theme on Windows eclipse-pla…
Highlighting problem when using the dark theme on Windows eclipse-pla…
Highlighting problem when using the dark theme on Windows eclipse-pla…
Highlighting problem when using the dark theme on Windows eclipse-pla…
Highlighting problem when using the dark theme on Windows
Highlighting problem when using the dark theme on Windows
Revert "Highlighting problem when using the dark theme on Windows ecl…
Revert "Highlighting problem when using the dark theme on Windows
Revert "Highlighting problem when using the dark theme on Windows
Revert "Highlighting problem when using the dark theme on Windows