Bug 572827 - [Win32][DarkTheme] DateTime widget not respecting Theming
Summary: [Win32][DarkTheme] DateTime widget not respecting Theming
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.20   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 577357
  Show dependency tree
 
Reported: 2021-04-14 02:37 EDT by Matthias Becker CLA
Modified: 2022-01-18 06:28 EST (History)
4 users (show)

See Also:


Attachments
Bug on Windows (41.66 KB, image/png)
2021-04-14 02:37 EDT, Matthias Becker CLA
no flags Details
Working on macOS (61.27 KB, image/png)
2021-04-14 02:37 EDT, Matthias Becker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Becker CLA 2021-04-14 02:37:15 EDT
Created attachment 286097 [details]
Bug on Windows

On windows the DateTime widget renders with white background even when in the dark theme. On macOS is looks fine. I was not able to test this on linux.

You could easily see this with the "Resource Filters" dialog. You can reach that via: Context Menu on a project > Properties > Resource > Resource Filters > Add Filter.
Comment 1 Matthias Becker CLA 2021-04-14 02:37:31 EDT
Created attachment 286098 [details]
Working on macOS
Comment 2 Alexandr Miloslavskiy CLA 2021-05-03 14:37:55 EDT
I have studied 'aero.msstyles' and found matching class 'DatePicker'. Unfortunately, there is no support for Dark Theme yet.

I have also studied 'comctl32.dll!CDatePicker::_Paint()' that handles painting. It doesn't seem that anything can be customized there.

To summarize, I don't think that this can be solved with reasonable effort.
Comment 3 Matthias Becker CLA 2021-05-04 02:39:34 EDT
(In reply to Alexandr Miloslavskiy from comment #2)
> I have studied 'aero.msstyles' and found matching class 'DatePicker'.
> Unfortunately, there is no support for Dark Theme yet.
> 
> I have also studied 'comctl32.dll!CDatePicker::_Paint()' that handles
> painting. It doesn't seem that anything can be customized there.
> 
> To summarize, I don't think that this can be solved with reasonable effort.

So you are saying the problem is that the native widget on windows does not support styling?
Comment 4 Alexandr Miloslavskiy CLA 2021-05-04 07:04:19 EDT
Right.
Comment 5 Matthias Becker CLA 2021-05-04 07:10:34 EDT
(In reply to Alexandr Miloslavskiy from comment #4)
> Right.

I am not a Windows User. Are there other native UIs that use that widget and have the same issue in the OSes dark mode?
Comment 6 Alexandr Miloslavskiy CLA 2021-05-04 07:12:56 EDT
Windows does not yet have any dark theme for native applications. What SWT does is a combination of hacks and workarounds. And DateTime seems to be a particularly difficult case.
Comment 7 Matthias Becker CLA 2021-05-04 07:16:45 EDT
(In reply to Alexandr Miloslavskiy from comment #6)
> Windows does not yet have any dark theme for native applications. 

What about https://uk.pcmag.com/migrated-3765-windows-10/122487/how-to-enable-dark-mode-in-windows-10
Comment 8 Alexandr Miloslavskiy CLA 2021-05-04 07:19:27 EDT
This only affects Windows Explorer (partially), some Metro-based applications, etc. But there is no dark theme for native applications yet. SWT is based on native applications framework.

You can enable Dark Theme setting in Windows and start the very basic Windows Notepad, for example. You'll see it yourself - no dark theme.
Comment 9 Matthias Becker CLA 2021-11-09 04:30:08 EST
(In reply to Alexandr Miloslavskiy from comment #8)
> This only affects Windows Explorer (partially), some Metro-based
> applications, etc. But there is no dark theme for native applications yet.
> SWT is based on native applications framework.
> 
> You can enable Dark Theme setting in Windows and start the very basic
> Windows Notepad, for example. You'll see it yourself - no dark theme.

Do we have the possibility to add a workaround solution in SWT side for this issue?
Comment 10 Alexandr Miloslavskiy CLA 2021-11-10 18:21:11 EST
As explained in Comment 2, according to my brief analysis, it's not something that can be solved easily, so it's going to require at least some effort.

Also, the product I'm working on is not using DateTime, therefore I won't be able to spend time here, sorry.
Comment 11 Alexandr Miloslavskiy CLA 2021-11-10 18:21:44 EST
As of current Win11, there is still no Windows dark theme for 'DatePicker'.