commit | 0c4bec3ebac33fe91e5435643d527391411fd4f2 | [log] [tgz] |
---|---|---|
author | Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> | Wed Aug 12 19:27:27 2020 +0200 |
committer | Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> | Fri Aug 14 15:42:33 2020 +0200 |
tree | 1815a82cda37f4e036c84a7e3ad8521d42783cec | |
parent | 2345a33c2289c62fe61a3b1ba2e73640130fbc46 [diff] |
Bug 562043 - [Win32][Dark Theme] Tables have no selection nor hover highlights Dark Theme in Windows is not yet official and has to rely upon undocumented APIs. There are two possible approaches: 1) Use SetWindowTheme("DarkMode_Explorer") 2) Use a combination of: SetPreferredAppMode() to allow dark theme per-process AllowDarkModeForWindow() to allow it for a window SetWindowTheme("Explorer") to activate it for a window In Bug 444560, approach (1) was selected due to relative simplicity of implementation. Windows itself uses approach (2) for select applications where Dark Theme is supported, such as Windows Explorer. Turns out, approach (1) is flawed. For 'Table' (based on native 'ListView' control), as of Win10 v2004, 'DarkMode_Explorer::ListView' is not yet present. This causes ListView to not recognize the theme, which in turn causes it to have default theme. At the same time, for many years now, it used "Explorer" theme. With approach (1), it is not possible to both have dark scrollbars and "Explorer" theme, at least I wasn't able to find such way after quite some research. Therefore, let's switch to approach 2. The upsides are: * it fixes the problem in Bug 562043 * it is closer to how Windows does things * when API is public, the code will probably not need many changes. The downsides are: * it's more complicated to make sure that APIs are still there. * supporting Win10 v1809 will require verifying yet another API. I decided that for simplicity, I'd simply declare it as unsupported. This patch discards previous code (no longer needed) from at least: * Bug 444560 - various parts of approach (1) * Bug 562330 - 'Table.darkExplorerTheme'. The real problem there was that Table reverted to default theme. Changes I observed: * Bug 562043 if fixed. * Table's header now highlights sort column. Change-Id: Ic93fcafe80569921f796e4d8ab0fd6f9b6a6f027 Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Thanks for your interest in this project.
See the following description for how to contribute a feature or a bug fix to SWT.
Information regarding source code management, builds, coding standards, and more and be found under the following link.
Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation Contributor License Agreement (CLA).
Contact the project developers via the project's “dev” list.
This project uses Bugzilla to track ongoing development and issues.
Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!