X2CommunityCore / xcom2-launcher

The Alternative Mod Launcher (AML) is a replacement for the default game launchers from XCOM 2 and XCOM Chimera Squad.
GNU General Public License v3.0
350 stars 52 forks source link

Windows Dark mode is not supported #308

Open Thunderforge opened 2 years ago

Thunderforge commented 2 years ago

AML Version: 1.4.1

Description When Windows 10 or 11 is set to open apps in Dark mode, AML should also be in Dark mode.

As-is, AML ignores Dark mode and always appears in Light mode.

Attachments image

Iridar commented 2 years ago

It's not a bug, AML just doesn't support dark mode.

Thunderforge commented 2 years ago

I’m not sure I’m following. It’s not a bug that it doesn’t follow the Windows setting that other apps follow? Are you saying this is a feature request to do what every other app does?

Regardless of classification, I think this app should be Dark when in Dark mode. It’s jarring to have a dark web browser and Explorer (and a dark Steam and XCOM 2), but a blindingly bright AML.

Iridar commented 2 years ago

I’m not sure I’m following. It’s not a bug that it doesn’t follow the Windows setting that other apps follow? Are you saying this is a feature request to do what every other app does?

Correct. While most commercially supported applications have been updated to support dark mode, it's still something that needs to be done for every app separately.

Regardless of classification, I think this app should be Dark when in Dark mode. It’s jarring to have a dark web browser and Explorer (and a dark Steam and XCOM 2), but a blindingly bright AML.

I'm sure everybody realizes that it would be great if AML supported dark mode. The reason it hasn't been done yet is not because it hasn't been requested enough, but because so far there has been little interest in anyone actually doing the legwork on it.

remcoros commented 1 year ago

Some background:

The UI tech used is Winforms, on .NET 4.7.1, it is technically possible to implement a dark mode, but takes quiet a bit of effort (need to hook into native windows methods, or use a c# library which helps you a bit). the "Git Extensions" project (version 3!) is a good example.

Slight problem is, most of Microsoft effort is going into .NET 6 and onwards, which has winforms now, but no native support for dark mode yet, and they also broke support for the hooking method. Git Extensions project ran into this when going to .NET 6, and I think their maintainer is even a dev on the MS winforms team :)

So long answer short, probably not going to happen without moving to another UI tech completely, or a community contribution using any of the .NET 4.7/4.8 methods.

RevZero commented 1 year ago

Its would also be possible to recursively work through the controls of any parent form and changed fore- and background colors depending on an AML internal option. But it would require special handling of some controls like the ObjectListView to set additional colors. I am not even sure if its possible to actually change all the colors through the control properties, because some controls may always use specific windows system colors.

remcoros commented 1 year ago

I'm no expert in this, but from what I've seen in other winforms projects, a lot of controls do not expose ALL the possible things you need to change to get a consistent dark look (the ones that do it like this, look very out of place compared to WinUI apps). That's why those libraries/projects need to hook into the win32 api's and do some hacky things in the internals of those controls (overriding Draw methods and stuff).

This might be a good starting point for some examples/info if anyone wants to give it a shot: https://github.com/gitextensions/gitextensions/pull/7213