Community
Participate
Working Groups
AFAIK we are currently using custom drawing for Windows to style the buttons. As Windows also has the native stying for windows toolbars, scrollbars, etc I assume we could also not set the background color and rely on the native dark styling of buttons.
Alexandr, does the dark mode on windows also affects the button background?
Indeed Windows has a custom dark theme for Button, 'DarkMode_Explorer::Button'. I can look into that later. If you're interested, try calling 'Display.maybeEnableDarkSystemTheme()' in 'Button.createHandle()' and see what happens.
This themes are already (partly) used for the buttons, tough I expect that code is not robust, see also Bug 575352.
Rolf, I'm not sure what you mean here. My guess is that you're talking about 'Display.hButtonTheme'? I had a look now and it seems that it doesn't really affect buttons. Also, it doesn't seem to be connected to the undocumented 'DarkMode_Explorer::Button' in Win10. Therefore, I understand that Lars's suggestion and my reply are up to date.
Created attachment 287485 [details] Win10 screenshot
Created attachment 287486 [details] Win11 screenshot
On Win11, Button got rounded corners, and it's more obvious now that it has a white border in Dark Theme. Even though the difference is just a few pixels, it didn't catch my eye in Win10. Hopefully the undocumented Windows's Dark Theme will solve this.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189151
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189152
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189153
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189154
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189155
Here's what to pay attention to when using test snippet that I submitted along with patches: 1) It uses all combinations of Colors (Default, Light, Dark, Green) and Themes (Native Default, Native Light). For this reason, some controls always look weird: for example "Theme:Default Color:Default All:Dark" have barely readable labels in Check/Radio, because by default, they have black text. With simple words, if you notice something weird, pay attention to what combination you're looking at. 2) Native dark theme only affects Push/Toggle currently. As of Win11, they don't have support for check/radio. 3) There's a colors selector at the bottom.
Created attachment 287737 [details] Win11_BeforePatch
Created attachment 287738 [details] Win11_AfterPatch
Lars, with this series of patches, it is no longer needed to set custom Button colors on Win10+. It also fixes a few other visual problems. Eclipse will activate this patch automatically because it's connected to the old Display.setData() property already used in Eclipse. Enjoy your slightly late Christmas present :) I trust that you will do Eclipse testing?
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189151 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=b9f490267b67e0add3841f848d649c9168fc9b2e
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189154 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=d38e7cd2f31644e817710d071e2aa377a8701202
(In reply to Alexandr Miloslavskiy from comment #16) > Enjoy your slightly late Christmas present :) Awesome, thanks. Sorry was in vacation so I did not see your update.
Lars, please give it a try.
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189152 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=00d493619eef331d2e5ea8440e7ed1cabe43565b
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189153 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=2068b49040cd021c7879549b9ce02113bd40af99
(In reply to Alexandr Miloslavskiy from comment #20) > Lars, please give it a try. In the default dark theme, Eclipse looks the same (for me). I assume the current dark theme which styles button triggers the custom drawing code. I plan to remove the dark styling for buttons via Bug 578157.
Are you on Win10 or Win11? Either way, Eclipse shouldn't look the same. The thick light frame around buttons should be no more, that's the most visible change. See screenshots attached in this Bug.
Created attachment 287813 [details] Screenshot - Side by side (In reply to Alexandr Miloslavskiy from comment #24) > Are you on Win10 or Win11? > Either way, Eclipse shouldn't look the same. The thick light frame around > buttons should be no more, that's the most visible change. See screenshots > attached in this Bug. This is what I see. The gray border in 2022 is focus related. I also get it in 2021-12 if I focus the dialog.
> (In reply to Alexandr Miloslavskiy from comment #24) > > Are you on Win10 or Win11? I'm using Windows 10 Pro build 19042.1415
Created attachment 287818 [details] Win10 Eclipse before patches
Created attachment 287819 [details] Win10 Eclipse after patches Lars, judging from your screenshots, you're testing without patches applied. Note that 'master' still doesn't have all patches. As for 'I20220110-0550' on the right of screenshot, it is missing even more patches that were merged yesterday. I have posted proper screenshots from Win10 with and without patches.
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189155 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=528429b3f99c6b8ba46abcea00c0889506a7dea3
(In reply to Eclipse Genie from comment #29) > Gerrit change > https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189155 was > merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=528429b3f99c6b8ba46abcea00c0889506a7dea3 Thanks Alexandr for the efforts on this bug. @Lars All patches have been merged today, so next Eclipse IBuild should be good for testing.
Note, that on Windows, PDE API reports a false positive error, see bug 578228. I will push a fix in a moment.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189672
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189672 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=d0731009a730614b667af1dc4df67f3bac40896e
Thanks all for your assistance with this patch!
Thanks for this work, Buttons under Windows look much nicer now.
(In reply to Lars Vogel from comment #35) > Thanks for this work, Buttons under Windows look much nicer now. Thanks Lars for the feedback, resolving now.
N&N is pending here.
Lars, would you please make the N&N entry?
(In reply to Alexandr Miloslavskiy from comment #38) > Lars, would you please make the N&N entry? Yes, can do.
New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/189934
Gerrit change https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/189934 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=f358cc6316780c54fe7741f3c3c4c7ec94e10b1f
Verified on Win10 using Eclipse Build id: I20220216-1800
I previously opened a bug for a similar issue that was fixed by this pull request: https://bugs.eclipse.org/bugs/show_bug.cgi?id=576812 (Note that I was immediately dismissed since I reported the issue in the form of a question) I believe that answering my question from #576812 may have been able to produce a better result than calling maybeEnableDarkSystemTheme() for buttons since the results are not always desirable. I've opened a new github issue to discuss the issue that I am now seeing by using the default dark explorer theme. https://github.com/eclipse-platform/eclipse.platform.swt/issues/483
The interesting thing is, before making the changes for this bug, not all buttons were created with those thick borders. Which was the question that I was asking in https://bugs.eclipse.org/bugs/show_bug.cgi?id=576812