Community
Participate
Working Groups
Created attachment 282420 [details] Find actions Dark theme on Windows The hover colour for entries in the Find Actions windows is blue on Windows. This looks a bit odd IMHO and is inconsistent with the hover effect in the project explorer, preferences and other trees and tables throughout the UI.
Created attachment 282893 [details] No select nor hover The problem seem to have gotten *much* worse in 4.16. I've installed the latest Platform SDK nightly build, Find Actions has lost both selection highlights and hover highlights. In the attached screenshot, I've pressed the down key 4 times (pressing Enter would open the Debug View), and I'm hovering over an element in the middle of the Find Actions list. There is no longer any visual indication of either of these.
(In reply to Pierre-Yves B. from comment #1) > (pressing Enter would open the Debug View) *Bookmarks view, was reading text from below :)
CSS theming is in Platform UI, not SWT.
Piere-Yves, how does it look with theming disabled? As we removed the custom drawing we should see SWT standard.
Created attachment 282897 [details] Highlights without theming Without theming, you can see both selection and hover highlights. My gut feeling: there may be a bug with the SWT dark mode for tables on Windows (hence why I put the bug in Platform SWT, Andrey). Not sure when this bug was introduced. With the custom selection and hover CSS styling that was previously applied to tables on Windows in 4.15, the custom selection highlight was visible as expected (though the hover looked ugly, as described in my initial message in this bug report).
Pierre-Yves, please try to reproduce with a SWT only snippet and post it here. Adding Alexandr, he may be able to give clues what is wrong here.
Created attachment 282901 [details] HoverHelp wit dark mode (In reply to Lars Vogel from comment #6) > Pierre-Yves, please try to reproduce with a SWT only snippet and post it > here. Adding Alexandr, he may be able to give clues what is wrong here. Not entirely sure how to programmatically enable the dark mode. Would be worth mentioning in the N&N, even if it's still experimental. After digging through some Platform UI code I found "OS.setTheme", I'm assuming that switch is sufficient. Keeping that in mind, I launched the HoverHelp.java example in the SWT codebase after modifying it to add OS.setTheme(true). See attachment for the visual result. On the left you have a table. The selection is blue with a doted border. There is no hover highlight. On the right, you have a tree. The first dark line is selected, the second one is hovered over. On top, you have a few tool items. I didn't manage to capture this is the same screenshot, but there is yet a different selection and hover effect, different from the tree and table ones. When the various elements become inactive, there is also another set of inconsistent effects which I haven't described here. You can also observe these behaviours in the IDE's various preference pages of the latest nightly build. In addition to the Find Actions problem and the other discrepancies I've just described, I'm getting other worrying side effects with the new dark theme capabilities, for example Bug 563270. Unless I'm the only one facing these issues, given how close it is to 4.16 M3 the various Eclipse leads should probably start a conversation on the way forward :)
Created attachment 282910 [details] Simple dark SWT Table and Tree
(In reply to Pierre-Yves B. from comment #1) > The problem seem to have gotten *much* worse in 4.16. I've installed the > latest Platform SDK nightly build, Find Actions has lost both selection > highlights and hover highlights. I have used the SWT snippet posted above and it has both selection and hover highlights. My conclusion is that problem occurs on Eclipse side, which is outside my scope. > Not entirely sure how to programmatically enable the dark mode. Would be > worth mentioning in the N&N, even if it's still experimental. Yes, N&N is pending. > On the left you have a table. The selection is blue with a doted border. > There is no hover highlight. > > On the right, you have a tree. The first dark line is selected, the second > one is hovered over. > > On top, you have a few tool items. I didn't manage to capture this is the > same screenshot, but there is yet a different selection and hover effect, > different from the tree and table ones. Is there a problem?
Oops, I forgot `OS.setTheme(true)` in my snippet. Indeed, with it, Table has different selection color and no hover highlight.
Created attachment 282911 [details] Simple dark SWT Table and Tree
In order to get dark scrollbars, SWT requests "DarkMode_Explorer" theme which has dark scrollbars. "DarkMode_Explorer" is partially implemented Windows theme. It has "DarkMode_Explorer::TreeView" which alters Tree to be better compatible with dark theme. But it doesn't have "DarkMode_Explorer::ListView" yet. ListView is native control SWT uses for Table. At the same time, SWT prefers to use "Explorer::ListView" over "ListView". "Explorer::ListView" is newer explorer-style theme. "ListView" is the default theme that most native applications use. It doesn't have hover highlight. So, when SWT requests "DarkMode_Explorer" theme, Windows can't find an entry for "DarkMode_Explorer::ListView" and defaults to classic "ListView". This is an unfortunate limitation of current dark scrollbars approach. Let's hope that Microsoft will extend their dark theme soon.
In any case, selected item shall always be visible. If it's not, that's an Eclipse side issue, because SWT snippet doesn't have this problem.
Table's hover color issue could probably be solved by overriding it with Eclipse CSS theming. Lars would know better than me.
(In reply to Alexandr Miloslavskiy from comment #14) > Table's hover color issue could probably be solved by overriding it with > Eclipse CSS theming. Lars would know better than me. No, we retired our custom drawing on table as it was causing blurry text. So we rely on "pure" SWT.
Thanks for all the info Alexandr! My first idea to help debugging this was to use the CSS Spy tool to have a quick overview of how Find Actions is built UI-wise and compare the styling, classes and SWT bits with other tables that don't have this problem. Unfortunately, CSS Spy doesn't seem to work on popups and other dialogs that are not part of the main IDE shell (e.g. preferences dialog). Any way to trick CSS Spy to display more information?
I think you can use plugin spy to see the class. Alt+Shift+F1
Spotted the following message from Brian de Alwis in the mailing list archive (https://www.eclipse.org/lists/platform-ui-dev/msg07916.html): "The CSS Spy lost that ability when we moved to the unified dialog. But I missed that ability too, and hacked it up to allow opening the CSS Spy from a dialog too. I'll clean it up and push it up." Brian, do you still have that code somewhere? Would be handy to get that functionality fixed in the CSS spy :)
*** Bug 563829 has been marked as a duplicate of this bug. ***
(In reply to Lars Vogel from comment #19) > *** Bug 563829 has been marked as a duplicate of this bug. *** Probably the same cause, though this bug here was about find actions initially, not content assist. Maybe worth renaming it to "Tables have no selection or hover highlights".
(In reply to Pierre-Yves B. from comment #20) > Maybe worth renaming it to "Tables have no > selection or hover highlights". +1, please go ahead.
For me with this bug its really hard to use the IDE is dark mode. Specially the content assist. I have switch back to light mode because of this bug 😕
*** Bug 564242 has been marked as a duplicate of this bug. ***
(In reply to Alexandr Miloslavskiy from comment #12) > In order to get dark scrollbars, SWT requests "DarkMode_Explorer" theme > which has dark scrollbars. > > "DarkMode_Explorer" is partially implemented Windows theme. It has > "DarkMode_Explorer::TreeView" which alters Tree to be better compatible with > dark theme. But it doesn't have "DarkMode_Explorer::ListView" yet. ListView > is native control SWT uses for Table. > > At the same time, SWT prefers to use "Explorer::ListView" over "ListView". > "Explorer::ListView" is newer explorer-style theme. "ListView" is the > default theme that most native applications use. It doesn't have hover > highlight. > > So, when SWT requests "DarkMode_Explorer" theme, Windows can't find an entry > for "DarkMode_Explorer::ListView" and defaults to classic "ListView". > > This is an unfortunate limitation of current dark scrollbars approach. Let's > hope that Microsoft will extend their dark theme soon. Would it be possible to fix this in SWT win without changes on the Microsoft side?
*** Bug 564538 has been marked as a duplicate of this bug. ***
Hi any updates or workarounds for using dark theme with selections ?
I did notice one thing whilst experimenting: I tried a completely empty theme (i.e. a CSS sheet without anything inside), but gave said theme an ID containing the keyword "dark" so that the code in org.eclipse.e4.ui.swt.internal.win32.DarkThemeProcessor calls OS.setTheme(true) automatically when enabling it. The bug still occurred, which indicates that there is no problem with the CSS, but rather a problem with how OS.setTheme(true) is impacting those table popups.
I understand that this bug deals with two problems: 1) No hover highlight in Table in Dark theme. I confirm that this happens even with bare SWT with no Eclipse, and as per Comment 12, this is an unfortunate side effect of dark scrollbars. It could possibly be helped with partial owner drawing. I consider this to be a cosmetic problem, which we don't really care about in our product, so I'm not very interested in solving it. 2) No highlight for selected item in Table Comment 11 contains a snippet with a Dark Table, and the problem does not reproduce. I therefore understand that this is an Eclipse problem and now an SWT problem. I could look into this, but I will need one of two: a) Reproducing snippet. That would be best. b) Steps needed to see it in Eclipse. Remember that I'm not an Eclipse user and I barely know anything about it.
(In reply to Alexandr Miloslavskiy from comment #28) > I understand that this bug deals with two problems: > > 1) No hover highlight in Table in Dark theme. > I confirm that this happens even with bare SWT with no Eclipse, and as per > Comment 12, this is an unfortunate side effect of dark scrollbars. It > could > possibly be helped with partial owner drawing. I consider this to be a > cosmetic > problem, which we don't really care about in our product, so I'm not very > interested in solving it. > > 2) No highlight for selected item in Table > Comment 11 contains a snippet with a Dark Table, and the problem does not > reproduce. I therefore understand that this is an Eclipse problem and now > an > SWT problem. I could look into this, but I will need one of two: > > a) Reproducing snippet. That would be best. > b) Steps needed to see it in Eclipse. Remember that I'm not an Eclipse > user > and I barely know anything about it. I can help with the steps, 1. Run Eclipse with workspace 2. Press CTRL+3 3. This will show a popup with a table which is the "Find Action" view 4. In the search are type "Git" for example. Now press the down arrow key to highlight items in the table. You can see that the selection is not drawn with the selection background color.
Thanks for the steps. It does reproduce for me. Studying it, I found that changing `Table#explorerTheme` to false in dark theme fixes the problem. And it actually needs to be false as per Comment 12, because Win10 doesn't currently have a dark theme entry for ListView, so trying to set it causes ListView (Table in SWT) to use default theme instead. On the other hand, setting dark theme changes scrollbars to dark. I'm rather worried about changing `Table#explorerTheme` to false, because I suspect that most users only tested it with true in the last 10-15 years, so any number of new problems can pop up. I'm currently trying to find if it's possible to only change scrollbars but leave the other parts of Table intact. No success so far.
*** Bug 564822 has been marked as a duplicate of this bug. ***
*** Bug 565605 has been marked as a duplicate of this bug. ***
(In reply to Alexandr Miloslavskiy from comment #30) > Thanks for the steps. It does reproduce for me. > > Studying it, I found that changing `Table#explorerTheme` to false in dark > theme fixes the problem. And it actually needs to be false as per Comment > 12, because Win10 doesn't currently have a dark theme entry for ListView, so > trying to set it causes ListView (Table in SWT) to use default theme > instead. On the other hand, setting dark theme changes scrollbars to dark. > > I'm rather worried about changing `Table#explorerTheme` to false, because I > suspect that most users only tested it with true in the last 10-15 years, so > any number of new problems can pop up. > > I'm currently trying to find if it's possible to only change scrollbars but > leave the other parts of Table intact. No success so far. What if we have this with a feature switch. So some group of people can tryout this option with the flag on and report bugs if we found any. Otherwise we can enable this by default in the next release. WDYT ?
I'm going to submit a patch that reworks dark scrollbars on Windows and removes this problem. Need some time to finish this patch.
(In reply to Alexandr Miloslavskiy from comment #34) > I'm going to submit a patch that reworks dark scrollbars on Windows and > removes this problem. Need some time to finish this patch. Thanks a lot, Alexandr
(In reply to Lars Vogel from comment #35) > (In reply to Alexandr Miloslavskiy from comment #34) > > I'm going to submit a patch that reworks dark scrollbars on Windows and > > removes this problem. Need some time to finish this patch. > > Thanks a lot, Alexandr Next week we will have M3. Would be great to have this in for the 4.17 release.
We also have an upcoming release and there are problems to solve in another 3rd party library :( I think I carved some time for SWT, so I'll try to finish the patch before more issues come to demand my attention.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/167619
OK, here's the patch. Lars, would you do the testing?
Created attachment 283854 [details] Screenshot with fix from Alexandr Looks much better with the fix.
Created attachment 283855 [details] Screenshot for code completion with fix
Comment on attachment 283855 [details] Screenshot for code completion with fix Can’t we change the color from css or make it any brighter?
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/167619 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=0c4bec3ebac33fe91e5435643d527391411fd4f2
Verified in I20200818-0900: * Problem in Ctrl+3 is solved * Dark Scrollbars still work as expected * Various pages in Eclipse Settings look reasonable
Checked the latest build as well, the dark theme is usable again on Windows. Thanks for working on this Alexandr!
Created attachment 283910 [details] Dark menus in Eclipse on Windows I just noticed that the Windows menus were now styled in the dark theme?!? This was not the case in earlier 4.17M2. Is this an unexpected side-effect of this patch or does it come from somewhere else? Either way, it's really neat, and would deserve a N&N mention!
Yes, this is a side effect of this patch. I totally forgot about it because in our product we used a similar approach for a long time. The dark popup menus are enabled with 'SetPreferredAppMode', which is part of new approach in SWT since my last patch.
If anyone is willing to do a N&N entry, you're welcome to do so.
(In reply to Alexandr Miloslavskiy from comment #47) > Yes, this is a side effect of this patch. I totally forgot about it because > in our product we used a similar approach for a long time. The dark popup > menus are enabled with 'SetPreferredAppMode', which is part of new approach > in SWT since my last patch. Awesome! Thanks a bunch Alexandr! 4.17 will be a great dark theme windows release thanks to your work.
New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/167992
(In reply to Alexandr Miloslavskiy from comment #48) > If anyone is willing to do a N&N entry, you're welcome to do so. For menu: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/167993
Gerrit change https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/167992 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=0d1781da9f6948490aeeb18f11b181c821468111
(In reply to Gayan Perera from comment #42) > Comment on attachment 283855 [details] > Screenshot for code completion with fix > > Can’t we change the color from css or make it any brighter? Great work has been done here. However, the selection color of not active trees doesn't have any contrast w.r.t. the the dark background. As a result, the dark theme is still useless to be used in daily practice. Can this selection color be changed? Please comment in Bug 564960.
(In reply to Rolf Theunissen from comment #53) > (In reply to Gayan Perera from comment #42) > > Comment on attachment 283855 [details] > > Screenshot for code completion with fix > > > > Can’t we change the color from css or make it any brighter? > > Great work has been done here. However, the selection color of not active > trees doesn't have any contrast w.r.t. the the dark background. As a result, > the dark theme is still useless to be used in daily practice. > > Can this selection color be changed? Please comment in Bug 564960. The problem is not in the selection color, but in the custom background color in the dark theme that is too close to the selection color.