Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#19223 closed enhancement (wontfix)

Add dark mode support on MS Windows

Reported by: HackerDaGreat57 Owned by:
Priority: lowest Milestone:
Component: wxMSW Version: dev-latest
Keywords: dark mode Cc: atomic.alarm@…, dcon@…, ericj, contact.akshatsingh@…
Blocked By: Blocking:
Patch: no

Description

I think that wxWidgets desperately needs Dark Mode for Windows. And I know that this is possible in a native Windows app. https://www.nchsoftware.com/videopad/index.html For example, VideoPad looks like it has a Dark Mode interface while still utilizing the native components. I want something like that without having to reinvent the wheel just for a theme that's easy on the eyes.

A lot of the controls available in VideoPad are not in the screenshot, so if you want to take a look at all of them, you first need the product key to unlock the editor: "210870705-mnrdenzi" (without the quotes of course).

So far, I think that VideoPad might use wxWidgets. It has native components everywhere and there is a Mac version too. This might indicate that this software is made in wxWidgets. Or it could be made in win32, and the Mac version might be made in Cocoa. I dunno, but what I do know is that we need dark mode on windows!! (And yes, setting background & foreground colors is NOT the solution. I have tried that and my app looked uglier than it did when it was in light mode.)

This is my first ticket, so please leave constructive feedback on my ticket-writing skills.

Attachments (1)

Screenshot (1714).png download (136.2 KB) - added by HackerDaGreat57 5 months ago.
Dark mode screenshot

Download all attachments as: .zip

Change History (17)

Changed 5 months ago by HackerDaGreat57

Dark mode screenshot

comment:1 Changed 5 months ago by HackerDaGreat57

  • Cc contact.akshatsingh@… added
  • Priority changed from high to blocker

comment:2 Changed 5 months ago by pb101

  • Component changed from GUI-all to wxMSW
  • Keywords dark mode added; Dark Mode Windows removed
  • Milestone 3.1.6 deleted
  • Priority changed from blocker to normal
  • Summary changed from Windows Dark Mode!! to Add dark mode support on MS Windows
  • Version changed from 3.1.5 to dev-latest

I will be optimistic and assume this is not a poor trolling attempt no matter how much it may look like one so I am not closing the ticket.

Did you take a look at the recent discussion in the mailing list and believe you have a new helpful information?

If you did you must know that there is an actual open source wxWidgets application trying to use dark mode on Windows? Did you check it out and what do you think?

AFAIK, dark mode on Win32 is not officially supported by the OS (see bundled Win32 applications such as Notepad) and all the implementations I saw seem to be brittle hacks (e.g., using a DLL ordinal which may change with a Windows update)? Am I wrong?

Do you believe that a library such as wxWidgets is at the liberty to use undocumented hacks that can easily crash the user programs at basically any time in the future?

Please also do not set a milestone or a priority above normal, this is of no help and intended only for the developers to use (I am not one, BTW).

EDIT
I took a look ad VideoPad and have two observations.

  1. It does not seem to use wxWidgets.
  2. At first glance, it does not do great job with dark mode. For example, menu, tooltips, and the options and search dialogs as well as other "prompt" dialogs remain "light".
Last edited 5 months ago by pb101 (previous) (diff)

comment:3 in reply to: ↑ description Changed 5 months ago by GreenDragon

  • Cc atomic.alarm@… added

Replying to HackerDaGreat57:

So far, I think that VideoPad might use wxWidgets. It has native components everywhere and there is a Mac version too. This might indicate that this software is made in wxWidgets.

As far I know you can check does the application written with wxWidgets with Ctrl+Alt+Scroll_click. At least on Windows the combination shows message box with wxWidgets version.

comment:4 Changed 5 months ago by HackerDaGreat57

  • Cc contact.akshatsingh@… removed

Thank you atomic.alarm. I'm on a laptop and my middle click emulator is not working, so thanks for proving that VideoPad uses wxWidgets. But the question is, how did NCH Software apply dark mode?? VideoPad is not free, miles away from open source, and I don't see a documentation on any of this.

P.S. This is not a trolling attempt. I'm just trying to make my app here.

P.P.S. I refuse to suffer the Netherish horrors of win32.

comment:5 Changed 5 months ago by HackerDaGreat57

  • Cc contact.akshatsingh@… added
  • Priority changed from normal to blocker

I'm changing the priority of this ticket because many, many more people need to see this.

I've been waiting for something like this since 2015, and I got tired of waiting around for this. I'm sure many, many other people also want dark mode in their apps.

comment:6 Changed 5 months ago by dconnet

  • Cc dcon@… added

how did NCH Software apply dark mode

I would bet they're custom drawing everything. Once-upon-a-time, I tried tweaking a standard Win32 listctrl to support dark mode (really, more of a dark skin - not a dark mode). I failed miserably (given the time allotted). (I forget the issues I ran into, I think it was the background and the header)

all the implementations I saw

The only one I heard of was some weird registry key.

comment:7 follow-up: Changed 5 months ago by HackerDaGreat57

  • Cc contact.akshatsingh@… removed

That's exactly what I'm saying: I don't want to reivent the wheel OR use win32. If you give me a win32 starter application source file, I'll just close it and rename it to "farsi.cpp". If you tell me to custom-draw an element, I'll just start looking for "widget addons" on Google or just use C++Builder and VCL.

(C++Builder only makes x86 applications and is really really REALLY outdated, so I'm not using it for my app, Blender++)

Last edited 5 months ago by HackerDaGreat57 (previous) (diff)

comment:8 in reply to: ↑ 7 Changed 5 months ago by oneeyeman

  • Priority changed from blocker to normal

Hi,
Replying to HackerDaGreat57:

That's exactly what I'm saying: I don't want to reivent the wheel OR use win32. If you give me a win32 starter application source file, I'll just close it and rename it to "farsi.cpp". If you tell me to custom-draw an element, I'll just start looking for "widget addons" on Google or just use C++Builder and VCL.

(C++Builder only makes x86 applications and is really really REALLY outdated, so I'm not using it for my app, Blender++)

Did you look at the discussion suggested by pb101?
Also, please understqand - changing the bug statrus/priority won't give it any priority. In fact - it could be put at the end of the queue.

Those 2 fields are for core wx developers to prioritize the tickets. Not for you, me or anyone else to set.

Now, in refgards to the "Dark Mode" - the discussion referenced by PB101 indicates that Win32 API does not have "Dark Mode" support. And MS doesn't have plans to support Dark Mode inside Win32 API. Dark Mode is supported inside .NET and C#.

So, all applications currently on the market that is written in C++ are using custom drawing for everything to support "Dark Mode" as MS itself won't have such support.

Now if you want to - you can create an appropriate color scheme and use it in your app. But as long as MS doesn't have such support - wxWidgets won't have it either, unless someone creates an appropriate changes and submit it to be included in the library.

Also, if the application you referenced is actually being written in wxWidgets - it is using a lot of custom drawing.

comment:9 Changed 5 months ago by HackerDaGreat57

  • Cc contact.akshatsingh@… added
  • Resolution set to wontfix
  • Status changed from new to closed

Mhm. So I have no option but to reinvent the wheel. Not a problem, I just wanted to save some time by using an inbuilt theme.

Thanks for the help. I learned some new things today, like how to write a ticket, and which GUI toolkit that NCH uses (I've been pondering that one for quite a while now since I don't have a middle mouse button).

In case you guys/gals want to know about Blender++, it's basically a remake of Blender - but with many more capabilities like advanced video editing, a Photoshop-like editor, document editors, etc (Basically everything mashed up into one software). It's repository will be located at https://github.com/HackerDaGreat57/bpp. The repo will be created on July 20 (That's when planning ends and development starts).

comment:10 Changed 5 months ago by HackerDaGreat57

  • Cc contact.akshatsingh@… removed
  • Priority changed from normal to lowest
  • Resolution wontfix deleted
  • Status changed from closed to reopened

Alright, I'll just leave this ticket open for any devs that may stumble across this and decide to do something about it... ("do something about it" as in implementing inbuilt custom dark components. I might create a PR on the official wx repo on GitHub about this in the future instead.)

comment:11 Changed 5 months ago by pb101

I would strongly prefer this ticket to be closed as it basically contains, aside from two posts, just utterly useless overly dramatic complaints and boasts, irrelevant information, and worse, untruths.

Untruths

VideoPad using wxWidgets confirmed

VideoPad does NOT display wxWidgets information (i.e., wxInfoMessageBox()) after <Ctrl><Alt><MiddleClick> into an "empty" area. However, this may be disabled by modifying wxWidgets sources. But the GUI looks quite different, the ribbon is not wxRibbon, tabbed dockable UI looks different from wxAui, even the splitter is not the same. Inspecting its executable also does not show the usual embedded strings that are there for wxWidgets-using applications. Additionally, wxWidgets is not mentioned in its about dialog where it lists the 3rd party software used.

Win32 application can use dark mode with a Registry setting

Another obvious untruth, the procedure used is basically always based on hacks like this. In other words using undocumented DLL exported functions and window class names and control-specific code.


Facts

As I already wrote here, an example of open source wxWidgets application attempting to implement dark mode on Windows is PrusaSlicer.

As for popular open source pure Win32 applications implementing dark mode, there is for example Notepad++. Chrome and Firefox have to deal with this as well, but they do not use native controls much, providing their own implementation.

The biggest problem with dark mode and Win32 is that Microsoft does not support it and spent just the smallest possible effort to make File Explorer work with it. For example other bundled Win32 applications such as Notepad, WordPad, and Paint are dark mode unaware.

This means that not all common controls may support dark mode, the same goes for the common dialogs with the exception of IFileDialog-based dialogs File Explorer uses. The issue is not just with colors but it seems that even if a control may have a basic support for dark mode, some styles (e.g., borders) may not work well with it. GetSysColor() not supporting dark mode is the least issue.

The OP touted VideoPad as a great example of Win32-based application using dark mode but in my first post I listed a bunch of rather noticeable issues I found in about a minute in total (but I knew where to look based on my experiences with this) and I would be surprised if there were not more.

TLDR

Properly implementing dark mode for a Win32 application is very difficult, perhaps even impossible due to limitations imposed by Windows. Doing the same in the library is even harder. There is no doubt that dark mode is a highly requested feature, if it was reasonably possible it would be already implemented.

comment:12 Changed 5 months ago by vadz

@pb101 We can close it, and I dislike OP's tone too ("desperately", really?), but OTOH I don't think we have another issue tracking this and it could be potentially useful to have one and you did post a number of useful links here. So I think it could remain open, but if you strongly prefer closing this one, we could do it too.

comment:13 follow-up: Changed 5 months ago by ericj

  • Cc ericj added

I just wanted to add one piece of information:

For the Windows Store in Windows 11, MS announced that it now supports "traditional desktop apps" and explicitly mentions the Win32 API:
https://developer.microsoft.com/en-us/microsoft-store/desktop-apps/

If they're not dropping Win32 just yet, maybe there's still hope for dark mode support for it.

comment:14 in reply to: ↑ 13 Changed 5 months ago by pb101

  • Cc pbfordev@… added

Replying to ericj:

For the Windows Store in Windows 11, MS announced that it now supports "traditional desktop apps" and explicitly mentions the Win32 API

Perhaps. But it may be just as likely an attempt to increase the popularity of the store.

I still believe that the Microsoft policy is: Win32 is dead, abandon the ship ASAP.

FWIW, I did look into trying to add dark mode to wxWidgets, i.e., when the app requests the dark mode use the undocumented APIs and class names for themes, fake the color in wxSystemSettings::GetColour(), and tweak the problematic generic controls. However, this seemed being far from easy and simple. IIRC, I was also surprised at how many places a custom/hardcoded color was used in the non-native controls. The main reason I abandoned this was that it seemed that even reasonably decent dark mode implementation was impossible, due to limits some Win32 controls have and lack of support of dark mode in the common dialogs. But perhaps I am wrong about this or a solution was find since then.

Additionally, I do not know if wxWidgets would even allow an implementation heavily relying on undocumented code. Although, it seemed that the approach used in win32-darkmode at least plays it somehow safe with those DLL imports and at worse, with a Windows update breaking this it should just stop working instead of crashing the app badly.

I still find this an interesting challenge but it seems to difficult for me, considering my lack of skills, time, and energy for something like this.

comment:15 Changed 5 months ago by pb101

  • Cc pbfordev@… removed

I normally do not use File Explorer nor Dark Mode. But seeing all those Dark Mode flaws in various 3rd party Win32 applications, I wanted to take a detailed look at how File Explorer, which should be THE Win32 application using Dark Mode does it.

I found it fails rather miserably:

  1. The prompt dialogs such as confirm Overwrite or Delete are light. So are the message boxes.
  2. The file/folder properties dialog is light.
  3. The Folder Options dialog is light.
  4. The dialog for choosing columns to display is light.
  5. The window displaying the progress of file copy is light.
  6. The controls displayed after clicking the filter arrow on the list columns headers in the details view are light.
  7. The folder list displayed after clicking on an arrow in the breadcrumb path bar is light.
  8. The checkboxes for list items are light.

Notepad, WordPad, Paint, Control Panel and other Win32 applications bundled with Windows being seemingly more or less abandoned and not supporting Dark Mode is not surprising.

However, it seems that Microsoft does not care about Dark Mode for Win32 applications even enough to make it look good in File Explorer, which may be the most used Windows-bundled application of them all and which also does not have its UWP equivalent.

My Windows information:
Edition: Windows 10 Pro
Version: 20H2
OS build: 19042.1083
Experience: Windows Feature Experience Pack 120.2212.3530.0

With Win11 upcoming I find it hard to believe that Microsoft are going to add Win32 Dark Mode support to Win10. But I may be wrong, hopefully.

EDIT
I tested the eight File Explorer issues listed above also with Windows 10 21H1 build 19043.1083 but it was the same as with 20H2.

Last edited 5 months ago by pb101 (previous) (diff)

comment:16 Changed 5 months ago by HackerDaGreat57

  • Cc contact.akshatsingh@… added
  • Resolution set to wontfix
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.